home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / c / cxt220.zip / SXT.DOC < prev   
Text File  |  1994-03-20  |  184KB  |  4,210 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.                   SXT (TM) SOFTWARE EXPLORATION TOOLS
  12.  
  13.  
  14.  
  15.                   CXT (TM) C EXPLORATION TOOLS
  16.  
  17.                     * CFT (TM) C FUNCTION TREE GENERATOR
  18.                     * CST (TM) C STRUCTURE TREE GENERATOR
  19.  
  20.  
  21.                   DXT (TM) DBASE EXPLORATION TOOLS
  22.  
  23.                     * DFT (TM) DBASE FUNCTION TREE GENERATOR
  24.  
  25.  
  26.                   FXT (TM) FORTRAN EXPLORATION TOOLS
  27.  
  28.                     * FFT (TM) FORTRAN FUNCTION TREE GENERATOR
  29.  
  30.  
  31.                   LXT (TM) LISP EXPLORATION TOOLS
  32.  
  33.                     * LFT (TM) LISP FUNCTION TREE GENERATOR
  34.  
  35.  
  36.  
  37.  
  38.                   Version March 1994
  39.  
  40.                   Copyright (C) Juergen Mueller (J.M.) 1988-1994.
  41.                   All rights reserved world-wide.
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.                                       - 1 -
  62.  
  63.  
  64.                              DISCLAIMER OF WARRANTY
  65.  
  66.         THIS  SOFTWARE  AND  ACCOMPANYING  WRITTEN  MATERIALS  (INCLUDING
  67.         INSTRUCTIONS FOR USE) IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF
  68.         ANY  KIND,   EITHER  EXPRESS  OR  IMPLIED,   INCLUDING,   WITHOUT
  69.         LIMITATION,  THE IMPLIED WARRANTIES OF MERCHANTIBILITY OR FITNESS
  70.         FOR  A PARTICULAR PURPOSE.  THE ENTIRE RISK AS TO THE RESULTS AND
  71.         PERFORMANCE OF THE SOFTWARE IS WITH YOU.
  72.  
  73.         IN NO EVENT WILL THE AUTHOR AND COPYRIGHT HOLDER  BE  LIABLE  FOR
  74.         DAMAGES,  INCLUDING  ANY  LOST  PROFITS,  LOST  MONIES,  OR OTHER
  75.         DIRECT,  INDIRECT,  GENERAL,  SPECIAL,  INCIDENTAL,  EXEMPLARY OR
  76.         CONSEQUENTIAL  DAMAGES  ARISING  IN  ANY  WAY  OUT  OF THE USE OR
  77.         INABILITY TO USE THIS PROGRAM (INCLUDING,  BUT  NOT  LIMITED  TO,
  78.         PROCUREMENT   OF   SUBSTITUTE   GOODS   OR   SERVICES,   BUSINESS
  79.         INTERRUPTION,  LOSS OF DATA OR DATA BEING RENDERED INACCURATE  OR
  80.         LOSSES  SUSTAINED  BY  YOU  OR  THIRD PARTIES OR A FAILURE OF THE
  81.         PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS) AND ON ANY THEORY  OF
  82.         LIABILITY, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES, OR
  83.         FOR ANY CLAIM BY ANY OTHER PARTY.
  84.  
  85.  
  86.                                  ACKNOWLEDGEMENT
  87.  
  88.         BY  USING  THIS  SOFTWARE YOU ACKNOWLEDGE THAT YOU HAVE READ THIS
  89.         LIMITED WARRANTY AND ACCOMPANYING  REMARKS,  UNDERSTAND  IT,  AND
  90.         AGREE  TO  BE  BOUND BY ITS TERMS AND CONDITIONS.  YOU ALSO AGREE
  91.         THAT THIS IS THE COMPLETE AND EXCLUSIVE  STATEMENT  OF  AGREEMENT
  92.         BETWEEN   THE  PARTIES  AND  SUPERSEDE  ALL  PROPOSALS  OR  PRIOR
  93.         AGREEMENTS, ORAL OR WRITTEN, AND ANY OTHER COMMUNICATIONS BETWEEN
  94.         THE PARTIES  RELATING  TO  THE  SUBJECT  MATTER  OF  THE  LIMITED
  95.         WARRANTY.
  96.  
  97.  
  98.         You  are expressly prohibited from selling this software or parts
  99.         of it in any form,  circulate it in any  incomplete  or  modified
  100.         form,  distribute  it  with another product (except on CD-ROM) or
  101.         removing this notice.  No one may modify  or  patch  any  of  the
  102.         executable  files  in  any  way,  including,  but not limited to,
  103.         decompiling,  disassembling or otherwise reverse engineering this
  104.         software in whole or part.
  105.  
  106.         The  documentation  may be distributed verbatim,  but changing is
  107.         not allowed. The informations and specifications in this document
  108.         are subject to change without notice.
  109.  
  110.         THIS  VERSION  OF  THE  DOCUMENTATION,   SOFTWARE  AND  COPYRIGHT
  111.         SUPERSEDES ALL PREVIOUS VERSIONS.
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.                                       - 2 -
  123.  
  124.  
  125.         This software and documentation is Copyright (C) by
  126.  
  127.                   Juergen Mueller
  128.                   Aldingerstrasse 22
  129.                   D-70806 Kornwestheim
  130.                   GERMANY
  131.  
  132.                   Email address: xmr@isw.uni-stuttgart.de
  133.                                  xmr@iswfs2.isw.uni-stuttgart.de
  134.  
  135.  
  136.         There  are no relations between the authors professional work and
  137.         the SXT development. SXT is an independent private project of the
  138.         author.
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.                                       - 3 -
  184.  
  185.  
  186.                                      LICENSE
  187.  
  188.         This version of the SXT Software Exploration Tools is NOT  public
  189.         domain or free software, but is being distributed as SHAREWARE.
  190.  
  191.         Non-registered  users  of  this  software  are  granted a limited
  192.         license for a 30-day evaluation period starting from the  day  of
  193.         the  first  use  to make an evaluation copy for trial use for the
  194.         express purpose of determining whether this software is  suitable
  195.         for  their  needs.  At  the  end  of this trial period you should
  196.         either register your copy or discontinue using this software. The
  197.         use of unregistered copies  of  this  software,  outside  of  the
  198.         initial  30-day  trial,  by  any person,  business,  corporation,
  199.         government agency or any other entity is strictly prohibited.
  200.  
  201.         This means that if you use this software, then you should pay for
  202.         your  copy.  This  software  is  NOT  free,   but  you  have  the
  203.         opportunity  to try it before you buy it.  Either pay for it,  or
  204.         quit using it.  A registration entitles you to use your  copy  of
  205.         this software on any and all computers available to you. If other
  206.         people  have  access  to  this  software  or  may  use  it,  then
  207.         additional copies or a site license should be purchased.
  208.  
  209.         All users are granted a limited license  to  copy  this  software
  210.         only  for  the  trial  use  of  others  and  subject to the above
  211.         limitations. This license does NOT include distribution,  selling
  212.         or  copying of this software package in connection with any other
  213.         product or service or  for  distribution  in  any  incomplete  or
  214.         modified form. Operators of electronic bulletin board systems and
  215.         software  servers  (like  INTERNET FTP-Servers) are encouraged to
  216.         post this software for downloading by their users, as long as the
  217.         above conditions are met.
  218.  
  219.         This package is expected  to  be  distributed  by  shareware  and
  220.         freeware  channels,  but  the  fees paid for "distribution" costs
  221.         (e.g.   disk,   CD-ROM)  are  strictly  exchanged   between   the
  222.         distributor and the recipient, and the author makes no express or
  223.         implied  warranties  about  the  quality  or  integrity  of  such
  224.         indirectly acquired copies. Distributors and users may obtain the
  225.         package directly  from  the  author  by  following  the  ordering
  226.         procedures in the REGISTER files.
  227.  
  228.  
  229.                               REGISTRATION REMINDER
  230.  
  231.         Unregistered copies of this software are 100% fully functional. I
  232.         make them this way so that you can have a real look at them,  and
  233.         then decide whether they fit your needs or not. This work depends
  234.         on your honesty. If you use it, I expect you to pay for it.  When
  235.         you  pay  for  the  shareware you like,  you are voting with your
  236.         pocketbook,  and will encourage me and others to develop more  of
  237.         these kinds of products.
  238.  
  239.  
  240.                  THANK YOU FOR SUPPORTING THE SHAREWARE CONCEPT
  241.  
  242.  
  243.  
  244.                                       - 4 -
  245.  
  246.  
  247.                   TABLE OF CONTENTS
  248.  
  249.                   1    THE SXT SOFTWARE EXPLORATION TOOLS
  250.                   2    GENERAL INTRODUCTION
  251.                   3    PROGRAM DESCRIPTION
  252.                   4    LANGUAGE IMPLEMENTATIONS
  253.                   4.1  C-LANGUAGE IMPLEMENTATION AND C-PREPROCESSOR
  254.                   4.2  C++ SOURCE CODE
  255.                   4.3  DBASE SOURCE CODE
  256.                   4.4  FORTRAN SOURCE CODE
  257.                   4.5  LISP SOURCE CODE
  258.                   4.6  ASSEMBLER SOURCE CODE
  259.                   5    DATABASE GENERATION
  260.                   6    PROGRAM LIMITATIONS
  261.                   7    IMPROVING EXECUTION SPEED
  262.                   8    COMMAND LINE SYNTAX DESCRIPTION
  263.                   9    OUTPUT DESCRIPTION AND INTERPRETATION
  264.                   10   INTEGRATION INTO PROGRAM DEVELOPMENT ENVIRONMENTS
  265.                   11   TOOLS FOR DATABASE PROCESSING
  266.                   12   TROUBLE SHOOTING
  267.                   13   FREQUENTLY ASKED QUESTIONS
  268.                   14   REFERENCES
  269.                   15   TRADEMARKS
  270.  
  271.                   APPENDIX 1: C-PRECOMPILER DEFINES
  272.                   APPENDIX 2: RESERVED C/C++ KEYWORDS
  273.                   APPENDIX 3: EFFICIENCY
  274.                   APPENDIX 4: SYSTEM REQUIREMENTS
  275.                   APPENDIX 5: INSTALLATION
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.                                       - 5 -
  306.  
  307.  
  308.         1    THE SXT SOFTWARE EXPLORATION TOOLS
  309.  
  310.         The  SXT  Software Exploration Tools are a collection of software
  311.         analysis tools providing a similar  functionality  for  different
  312.         programming  languages.  The  following  packages  are  currently
  313.         available:
  314.  
  315.         * CXT - C Exploration Tools:
  316.           CFT - C Function Tree Generator
  317.              Tool to analyse and display the function call  relationships
  318.              within the source code of C/C++ programs.
  319.           CST - C Structure Tree Generator
  320.              Tool    to   analyse   and   display   the   structure/class
  321.              relationships within the source code of C/C++ programs.
  322.  
  323.         * DXT - DBASE Exploration Tools:
  324.           DFT - DBASE Function Tree Generator
  325.              Tool to analyse and display the function call  relationships
  326.              within the source code of DBASE,  CLIPPER, FOXBASE and other
  327.              XBASE-like programs.
  328.  
  329.         * FXT - FORTRAN Exploration Tools:
  330.           FFT - FORTRAN Function Tree Generator
  331.              Tool to analyse and display the function call  relationships
  332.              within the source code of FORTRAN programs.
  333.  
  334.         * LXT - LISP Exploration Tools:
  335.           LFT - LISP Function Tree Generator
  336.              Tool  to analyse and display the function call relationships
  337.              within the source code of LISP and SCHEME programs.
  338.  
  339.         Each of these packages consists of the  analysis  program  and  a
  340.         recall program ("Navigator") to recall the analysis results which
  341.         can  be  stored in a database,  plus documentation and additional
  342.         macros to integrate these tools into popular editors like  BRIEF,
  343.         QEDIT or MicroEMACS.
  344.  
  345.         Each of these packages is available for the following systems:
  346.  
  347.              * DOS real mode          (shareware release)
  348.              * DOS 386 protected mode (registered users only)
  349.              * WINDOWS NT text mode   (registered users only)
  350.              * OS/2 text mode         (registered users only)
  351.  
  352.         * IMPORTANT * IMPORTANT * IMPORTANT * IMPORTANT * IMPORTANT *
  353.         Although this document is mainly based on the description for the
  354.         CXT  programs CFT and CST (which were up to version 2.13 the only
  355.         public available SXT programs) and therefore very C/C++  related,
  356.         the  description  applies  in  the  same  way  to  all  other SXT
  357.         packages.  The names CXT  resp.  CFT/CST  and  CFTN/CSTN  can  be
  358.         exchanged  by  the similar other product names.  Where necessary,
  359.         the specific differences of the SXT  packages  are  described.  I
  360.         have  done it this way to ensure an overall consistency,  to keep
  361.         all related things together and to reduce the efforts for writing
  362.         and maintaining this document.
  363.  
  364.  
  365.  
  366.                                       - 6 -
  367.  
  368.  
  369.         2    GENERAL INTRODUCTION
  370.  
  371.         The CXT programs are powerful  program  development,  maintenance
  372.         and documentation tools.  They provide the programmer the ability
  373.         to analyse the source code of applications,  no matter how big or
  374.         complex  they  are.  The  CXT  programs  are  also very useful to
  375.         explore unknown source code and to get  complete  overview  about
  376.         its   internal  structure.   The  re-engineering  of  old  and/or
  377.         undocumented  source  code  becomes  an  easy  task  with   these
  378.         programs.  The  tools  help the programmer to analyse,  identify,
  379.         locate and access all parts of a large software system.  They are
  380.         designed to support software reuse, maintenance and reliability.
  381.  
  382.         By  preprocessing,  scanning  and  analysing  the  entire program
  383.         source code as a single unit,  these programs build  an  internal
  384.         representation  of  the  function call hierarchy (CFT) and of the
  385.         data structure relations (CST). The resulting output shows from a
  386.         global  perspective  the   interdependencies   and   hierarchical
  387.         structure between the functions or data types of the whole, multi
  388.         file,  software  project.  Several features and options allow the
  389.         user to customise the generated hierarchy tree chart  output  and
  390.         to  get a large set of useful informations about the source code.
  391.         The hierarchy structure is always up-to-date because it relies on
  392.         the original source code as the primary  source  of  information.
  393.         Written  software  documentation  often  differs  from  that what
  394.         really has been coded,  so the source code itself is the ultimate
  395.         documentation.
  396.  
  397.         An  important  feature is the database generation.  It allows the
  398.         recalling of informations without reprocessing the  source  code.
  399.         The  database  can  again  be  read  in by CFT and CST to produce
  400.         different outputs or to add new files to  the  database.  Special
  401.         recall  programs  called  CFTN  and CSTN allow fast searching for
  402.         items in the database.  These programs can  be  used  within  any
  403.         environment,  for  example on the DOS command line or from inside
  404.         editors like BRIEF,  QEDIT or MicroEMACS (DOS  and  WINDOWS),  to
  405.         provide  a full software project management system with access to
  406.         all functions  and  data  types  with  just  a  keystroke.  These
  407.         features  make  a  comfortable "hypertext source code browser and
  408.         locator" system out of  your  editor.  A  project  consisting  of
  409.         several   files  appears  to  the  developer  as  if  it  were  a
  410.         'whole-part' of software. The developer can walk through programs
  411.         and trace the logic without having to  memorize  the  directories
  412.         and files where functions or data types are defined and called.
  413.  
  414.         Displaying   and  printing  a  graphical  representation  of  the
  415.         analysis results as a call graph is not  supported  bye  the  SXT
  416.         programs  but  owners  of  RATIONAL  ROSE,  a  powerful  software
  417.         development  case  tool  supporting  the  Booch   Object-Oriented
  418.         Analysis  and  Design  (OOAD) method,  can use this tool for such
  419.         purposes.  The SXT programs can generate compatible output  which
  420.         can  be  imported  by  Rational Rose.  See option -RATIONAL for a
  421.         detailed description.
  422.  
  423.  
  424.  
  425.  
  426.  
  427.                                       - 7 -
  428.  
  429.  
  430.         Listings of all functions/data types  and  source  files  can  be
  431.         written  as  formatted  ASCII text files and can be used as input
  432.         for  other  programs  like   word   processors   or   spreadsheet
  433.         calculators.
  434.  
  435.         A  useful  option  of CST is the possibility to generate a source
  436.         file  with  which  size  and   byte   offset   calculations   for
  437.         structures/unions and their members can be performed. This option
  438.         is  useful  especially  to support any kind of error searching or
  439.         hardware  debugging,  for  example  with  an  ICE,   or  if  data
  440.         structures  have  to  be  exchanged  between  different  hardware
  441.         platforms.
  442.  
  443.         CFT can also be used to analyse "C"-like languages  as  they  are
  444.         used  by  several  commercial  programs.  The  macro  programming
  445.         languages of the BRIEF, EPSILON and ME editors are such languages
  446.         and can be handled by CFT.
  447.  
  448.         The resulting output files can be used for various purposes  like
  449.         development or documentation.  There are no restriction limits in
  450.         using them for your own work.
  451.  
  452.         CFT and CST have been used  and  tested  since  1989  in  several
  453.         projects  with applications ranging from single source files over
  454.         medium sized projects (like CFT,  CST and  the  other  SXT  tools
  455.         themselves)  up  to very large software projects with hundreds of
  456.         source and include files (mixed C and assembler code),  more than
  457.         6 MB of source code,  more than 200000 lines,  2000 functions and
  458.         500 data types.
  459.  
  460.         A lot of public available C/C++  sources  (e.g.  GNU-C  compiler,
  461.         GNU-C library,  GNU-EMACS,  MicroEMACS, NCSA TCP/IP communication
  462.         software package, SUIT - The Simple User Interface Toolkit, NIHCL
  463.         - The  National  Institute  of  Health  C++  class  library,  F2C
  464.         Fortran-to-C translator,  several projects from Dr. Dobbs Journal
  465.         (DFLAT and BOB),  Microsoft sample code (MFC 1.0 and  2.0))  were
  466.         processed   (with   sometimes  surprising  results!)  during  the
  467.         development and have been used to test and improve the  features,
  468.         reliability,  correctness, robustness and execution speed of CFT,
  469.         CST and their related utilities.
  470.  
  471.         Although the other SXT packages are much newer than CFT and  CST,
  472.         they all are closely related. The CXT tools were used as the base
  473.         for all other packages.
  474.  
  475.  
  476.  
  477.  
  478.  
  479.  
  480.  
  481.  
  482.  
  483.  
  484.  
  485.  
  486.  
  487.  
  488.                                       - 8 -
  489.  
  490.  
  491.         3    PROGRAM DESCRIPTION
  492.  
  493.         CFT  builds  a  hierarchy  tree  chart of every function with the
  494.         called functions in it's own function block.  These functions are
  495.         again  used  as  a starting point for subsequent function blocks.
  496.         Starting the tree chart with the "main"-function it will  display
  497.         the  complete  function  flow  chart  and  the function hierarchy
  498.         dependency  of  the  whole  application  with  all  user  defined
  499.         functions and the called library functions.  Prototyped but never
  500.         defined or called functions are also detected. Recursive calls of
  501.         functions are recognised and displayed,  even over  several  call
  502.         levels.  Repeated  calls of previously displayed functions in the
  503.         output tree chart are detected and a message will be given with a
  504.         reference to their first appearance.  This prevents the output of
  505.         complete subtrees displayed earlier. Overloaded C++ functions and
  506.         operators  are  recognised  and  displayed  with  the  number  of
  507.         overloadings.
  508.  
  509.         CST acts similar to CFT but it works on  data  types  like  basic
  510.         types,  structures,  unions,  enumerations  and C++ classes.  CST
  511.         builds a hierarchy tree chart of every structure and  union  data
  512.         type  with  their internal elements and their related data types.
  513.         If these data types are again structures, unions or classes,  the
  514.         substructures will again be displayed.  CST recognises data types
  515.         defined by 'typedef' and derived from other data types.  The type
  516.         names  corresponding  to the same basic type are displayed in the
  517.         output file as 'alias' names for their  common  basic  data  type
  518.         name.  Every  feature  of  CFT  like  the  detection of recursive
  519.         declared  structures  and  unions,   references   to   previously
  520.         displayed data types and others are available and act similar.
  521.  
  522.         Every  function  (CFT)  and data type (CST) can be displayed with
  523.         the name of the source file and  the  line  number  where  it  is
  524.         defined.  The  output can be customised to display the tree chart
  525.         as a call-tree ("CALLER-CALLEE"-relation: "WHO CALLS WHOM") or as
  526.         a  caller-tree  ("CALLEE-CALLER"-relation:  "WHO  IS  CALLED   BY
  527.         WHOM"). This feature allows the user to determine which functions
  528.         are  called  from  a  specific  function  or  which functions are
  529.         callers of a specific function.
  530.  
  531.         The function and data type extraction from  the  source  code  is
  532.         done  by scanning and parsing the source.  There is absolutely no
  533.         need for the programmer  to  mark  functions  or  data  types  of
  534.         interest,   for  example  with  special  keywords,  starting  the
  535.         definitions at the  beginning  of  a  line  or  to  use  comments
  536.         containing  special  marks,  as  it is necessary for other source
  537.         code analysers and browsers.  CFT  and  CST  do  not  need  these
  538.         work-arounds,  any  source code can be processed without previous
  539.         work.  These tools are also compiler independent because they can
  540.         be customised to support any kind of compiler.
  541.  
  542.  
  543.  
  544.  
  545.  
  546.  
  547.  
  548.  
  549.                                       - 9 -
  550.  
  551.  
  552.         Several  useful  informations  and  software  metrics  about  the
  553.         processed source code and the included  files  can  be  generated
  554.         like
  555.  
  556.         -    file size and comment size in bytes for every file,
  557.         -    number of source code lines for every file,
  558.         -    number of included files for every source file,
  559.         -    total  effective number of scanned bytes and lines for every
  560.              source file and its included files,  if files  are  included
  561.              multiple times, this will influence the calculations,
  562.         -    for every defined function the number of lines, the code and
  563.              comment  size  in bytes,  the number of bytes per line,  the
  564.              number of functions  called,  the  number  of  flow  control
  565.              statements (if,  else,  for,  while,  case,  default,  goto,
  566.              return,  exit),  the maximum brace nesting level and if  the
  567.              function is used only inside the file,
  568.         -    for  every  defined  structure/union  the  total  number  of
  569.              elements and the number of  elements  which  are  themselves
  570.              structures/unions,
  571.         -    file function or data type reference list for every file,
  572.         -    total  number of displayed,  defined,  undefined or multiple
  573.              defined functions and data types,
  574.         -    location of all multiple defined functions and data types,
  575.         -    location of all overloaded C++ functions,
  576.         -    source file - include file  dependencies  for  every  source
  577.              file,
  578.         -    final statistical summary for all files,
  579.         -    cross  reference  of  every occurrence for every function or
  580.              data type,
  581.         -    parent/children relationship for  every  function  and  data
  582.              type,
  583.         -    critical  function  call path/structure nesting with deepest
  584.              non-recursive nesting level (unlimited tree depth),
  585.         -    C++ class inheritance graph,
  586.              and much more ...
  587.  
  588.         The resulting hierarchy structure chart is another representation
  589.         for a directed call graph.  A directed  call  graph  consists  of
  590.         nodes  (functions or data types) and connections (call relations)
  591.         between these nodes.  The number of nodes and  connections  which
  592.         are  necessary  to transform the hierarchy structure chart into a
  593.         directed call graph will also  be  calculated  as  an  additional
  594.         information about the system complexity.
  595.  
  596.         A  large  number  of options to control the program execution and
  597.         the output generation are available and can  be  defined  on  the
  598.         command  line,  by  command  files  or  by  defining  them  in an
  599.         environment variable used by the program.
  600.  
  601.         CFT and CST can  be  directly  invoked  from  inside  editors  or
  602.         integrated  development  environments  like  the Borland C++ IDE.
  603.         Detailed examples for the  integration  together  with  necessary
  604.         macro or batch files are given.
  605.  
  606.  
  607.  
  608.  
  609.  
  610.                                      - 10 -
  611.  
  612.  
  613.         3    LANGUAGE IMPLEMENTATIONS
  614.  
  615.         3.1  C-LANGUAGE IMPLEMENTATION AND C-PREPROCESSOR
  616.  
  617.         The  ISO/ANSI  C  language  standard  ISO/IEC 9899:1990 (E) resp.
  618.         X3.159-1989-ANSI C  as  described  in  several  books  about  the
  619.         C-language  (see references) was used as a development base.  The
  620.         reserved keywords being recognised  are  not  only  the  original
  621.         ISO/ANSI  C  keywords  but  were also taken from several compiler
  622.         implementations like Microsoft,  Borland or  GNU  and  their  own
  623.         special  language  extensions.  The  books  "The  C++ Programming
  624.         Language" and "The Annotated C++ Reference Manual" (ARM) together
  625.         with informations about the work of the ANSI C++ committee  X3J16
  626.         resp.  the  ISO/IEC working group SC22 WG21 were used for the C++
  627.         keywords.  Another major source was the  AT&T  C++  release  2.1.
  628.         Compiler   specific  extensions  especially  from  GNU  are  also
  629.         recognised.  Proposed extensions to C++ like additional  keywords
  630.         (e.g.  wchar_t) and the so called 'digraphs' will be supported if
  631.         they are introduced into the C++ language standard.
  632.  
  633.         A complete list of all reserved keywords is show in  appendix  2.
  634.         The  large  set  of  keywords may lead to some slight problems in
  635.         situations where a keyword is  not  used  as  itself  but  as  an
  636.         identifier name,  for example a C++ keyword used as an identifier
  637.         in C.
  638.  
  639.         During a normal file scan, precompiler defines are,  if possible,
  640.         handled  as if a real precompiler would be present,  but this can
  641.         cause some trouble with '#if',  '#ifdef'  and  other  precompiler
  642.         controls  which are not evaluated.  Also the block nesting level,
  643.         which will be monitored by the source code scanner, may not be at
  644.         level 0 at the end  of  the  file  because  of  such  precompiler
  645.         controls.  To avoid such things, a built-in C-preprocessor allows
  646.         the complete preprocessing of the source code and  include  files
  647.         for several compiler types as an additional option (-P).
  648.  
  649.         Preprocessing or not is a little bit controversial because it can
  650.         either  result  in  a  loss  of information if macros are used to
  651.         change the program behaviour and hide function calls, it can lead
  652.         to errors during file scanning or it can change the function  and
  653.         data  type  informations  obtained  from  the  code which may not
  654.         exactly correspond to the visible source code.  Preprocessing can
  655.         be an advantage or not, so the user has to decide whether he does
  656.         it or not.
  657.  
  658.         The  preprocessor  handles  the  defines  for  Microsoft  C  5.1,
  659.         Microsoft C/C++ 7.0,  Microsoft VC++ 1.0  for  Windows  NT  (Beta
  660.         Release June 1993),  Turbo C++ 1.0,  Borland C++ 2.0, Borland C++
  661.         3.1,  GNU-C and Intel 80960 C compiler iC960 3.0 and  all  memory
  662.         models  (not  necessary  for GNU-C and I960) or CPU architectures
  663.         for the Intel 80960 32 bit RISC processor (KA, KB,  SA,  SB,  MC,
  664.         CA).  Other  compiler types can be customised with the -B and the
  665.         -D options.  The default ISO/ANSI C predefined macros '__FILE__',
  666.         '__LINE__',    '__DATE__',    '__TIME__'    are   generated   for
  667.         preprocessing.   The  macro  '__STDC__'  is  NOT  defined   (some
  668.         compilers  test  with  '#ifndef __STDC__'),  so that non standard
  669.  
  670.  
  671.                                      - 11 -
  672.  
  673.  
  674.         ISO/ANSI C extensions in the processed code are allowed. Defining
  675.         '-D__STDC__=1' forces ISO/ANSI C conforming output  (if  used  by
  676.         the  scanned  source  code,  of  course!).  Additional  supported
  677.         precompiler  defines  are  '__TIMESTAMP__',  '__BASE_FILE__'  and
  678.         '__INCLUDE_LEVEL__'.   A  list  of  the  predefined  preprocessor
  679.         defines for the supported compiler types is shown in appendix  1.
  680.         Features  like  the replacing of trigraphs and the recognition of
  681.         C++ comments '//...' are also treated by the preprocessor.
  682.  
  683.         The precompiler recognises several errors or possible sources for
  684.         problems like
  685.  
  686.         -    the use of undefined variables in precompiler controls,
  687.         -    misbalanced '#if...' control block(s)  including  the  exact
  688.              location (file, line) where the failing block started,
  689.         -    recursive called include files,
  690.         -    wrong number of macro arguments (missing ones or too many)
  691.  
  692.         and displays diagnostic messages with an exact description of the
  693.         error or warning reason and its location in the source file.
  694.  
  695.  
  696.         3.2  C++ SOURCE CODE
  697.  
  698.         Although  CFT and CST were initially not developed to process C++
  699.         code it is possible  to  do  so.  In  that  case,  however,  some
  700.         restrictions and limitations should be considered.
  701.  
  702.         The  recognition  of  C++  classes  by CST is limited because the
  703.         handling of the internal class  structure  items  (variables  and
  704.         functions)  is too complex to fit in the CST program.  So classes
  705.         are only referenced by name but their internal structure will not
  706.         be scanned and displayed. The C++ class inheritance relationships
  707.         are recognised and shown  in  a  class  hierarchy  graph  listing
  708.         (option  -b).  Structures in C++ with function names as structure
  709.         members will  not  be  processed  correctly.  Templates  are  not
  710.         supported and will not be recognised.
  711.  
  712.         Calling  member functions will not be recognised correctly due to
  713.         missing class name,  this leads also to an incomplete call  tree.
  714.         The  use  of  overloaded functions with equal names but different
  715.         parameters  in  C++  programs  may  lead  to  incorrect   calling
  716.         relationships.  A variable initialization with parameters will be
  717.         misinterpreted as a function call.  A correct handling  of  these
  718.         and  other  C++  features  requires  a  complete  C++ source code
  719.         analyser to keep track of the class functions belong to  and  the
  720.         different calling parameters.
  721.  
  722.         If precise informations about C++ code are needed, utilities like
  723.         'class hierarchy browsers' or 'class viewers',  which are usually
  724.         (or should be) part of C++ compiler environments,  should be used
  725.         instead.
  726.  
  727.         Because of the above described reasons, some care should be taken
  728.         if C++ code is processed and displayed.
  729.  
  730.  
  731.  
  732.                                      - 12 -
  733.  
  734.  
  735.  
  736.         3.3  DBASE SOURCE CODE
  737.  
  738.         DFT  can  process  source code which is based on the DBASE III/IV
  739.         programming language. This means that also source code written in
  740.         DBASE derivatives like CLIPPER or FOXBASE can  be  analysed.  The
  741.         source  code analyser tries to be as correct as possible to build
  742.         a reliable hierarchy tree.  A function/procedure  declaration  is
  743.         recognised   by   the   FUNCTION  resp.   PROCEDURE  keyword.   A
  744.         function/procedure  call   is   recognised   by   the   following
  745.         statements:
  746.  
  747.              function()
  748.              CALL function
  749.              CALL function WITH parameters
  750.              DO function
  751.              DO function WITH parameters
  752.  
  753.         If  a  file  contains  no  function/procedure  declaration,   the
  754.         filename itself is  taken  as  procedure  name.  All  tokens  are
  755.         assumed   case-insensitive   and   are  converted  to  upper-case
  756.         characters.
  757.  
  758.  
  759.         3.4  FORTRAN SOURCE CODE
  760.  
  761.         FFT can process source which is based on the FORTRAN 77 standard.
  762.         Each FORTRAN  line  is  divided  into  fields  for  the  required
  763.         information, each column represents a single character.
  764.  
  765.              COLUMN    FIELD
  766.                   1    comment indicator (C,c,*,!)
  767.                 1-5    label
  768.                   6    indicator for line continuation
  769.                7-72    statement field (optionally up to column 132)
  770.  
  771.         Continuation  lines    are  merged before they are analysed.  The
  772.         number of continuation lines is 19 by default and can  be  varied
  773.         between  0 and 99 (option -qn).  The standard intrinsic functions
  774.         and additionally VAX-FORTRAN intrinsic functions are  recognised.
  775.         All  tokens  are  assumed  case-insensitive  and are converted to
  776.         upper-case characters.  If option -I is set,  INCLUDE  statements
  777.         are  recognised    and  handled.  Two  different types of include
  778.         statements are accepted:
  779.  
  780.         C TYPE 1: FORTRAN LIKE SYNTAX, INCLUDE STATEMENT STARTS IN
  781.         C         COLUMN 7, FILENAME IN SINGLE QUOTATION MARKS
  782.               INCLUDE 'FILENAME'
  783.  
  784.         C TYPE 2: C LIKE SYNTAX, INCLUDE STATEMENT STARTS IN
  785.         C         COLUMN 1 WITH #, FILENAME IN DOUBLE QUOTATION MARKS
  786.         #INCLUDE "FILENAME"
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.                                      - 13 -
  794.  
  795.  
  796.         The resulting function call graph may be  incorrect  due  to  the
  797.         ENTRY  capability  of  FORTRAN  which  allows direct jumps into a
  798.         function/subroutine  body.   This   may   result   in   incorrect
  799.         relationships   for  the  ENTRY  statement  and  the  surrounding
  800.         function/subroutine.
  801.  
  802.  
  803.         3.5  LISP SOURCE CODE
  804.  
  805.         LFT can process LISP and SCHEME source code.  The development  of
  806.         LFT  was mainly based on the GNU-EMACS LISP dialect as it is used
  807.         in the GNU-EMACS macro extension language and  its  functionality
  808.         was  tested mainly with these macro files.  LISP functions/macros
  809.         are  recognised  by  the  DEFUN  and  DEFMACRO  keywords.  SCHEME
  810.         functions are recognised by the DEFINE keyword, SCHEME processing
  811.         is  enabled  by option -XSCHEME.  Unnamed functions declared with
  812.         the  LAMBDA  keyword  can  be   recognised   optionally   (option
  813.         -XLAMBDA).   Tokens  are  assumed  case-sensitive.  Comments  are
  814.         recognised for ';' until end-of-line and between '#|' and '|#' as
  815.         multi line comment blocks.  The source code analysis is performed
  816.         in two passes. The first pass detects function/macro declarations
  817.         and  the  second pass analyses the relationships.  Function calls
  818.         via (funcall  <fcn>),  (function  <fcn>),  (apply  <fcn>),  (mapc
  819.         <fcn>)  and  similar constructs may not be correctly evaluated if
  820.         fcn is a function-symbol (e.g. given as a function parameter) and
  821.         not a valid function name.
  822.  
  823.         LFT was designed to work with different types of LISP source code
  824.         (as there are XLISP,  CLOS,  GNU-EMACS LISP,  ...),  although the
  825.         large  number  of  dialects  may  lead  sometimes  to  unexpected
  826.         problems.
  827.  
  828.  
  829.         3.6  ASSEMBLER SOURCE CODE
  830.  
  831.         As an additional feature,  CFT  and  FFT  can  process  assembler
  832.         source  code for the Intel 80x86 processors (MASM 5.1,  TASM) and
  833.         for the Intel 80960 RISC processors (or any other "AT&T UNIX-like
  834.         assembler"  like  GNU)  to  get   information   about   assembler
  835.         procedures  and  functions being called from the assembler source
  836.         files. The assembler source code scanner also detects and handles
  837.         calls of include files. This feature is useful for mixed language
  838.         programming. The processing of assembler macros, however,  is not
  839.         supported, the preprocessing option (-P) works only with C source
  840.         code.  Assembler  source  files  are  recognised  by  their  file
  841.         extensions '.ASM' and '.S', there is no other way to force a file
  842.         being processed as an assembler file.
  843.  
  844.         The following naming convention is  used:  For  '.ASM'  assembler
  845.         files  (MASM,  TASM) all identifiers are treated case-insensitive
  846.         and will be transformed to lower case characters, but identifiers
  847.         in '.S' (GNU,  I960) assembler files are treated  case-sensitive.
  848.         This  means,  that  an  assembler  function 'func1' defined in an
  849.         '.ASM' file can be called from the source  by  'func1',  'FUNC1',
  850.         'Func1'  or any other lower and upper case character combination.
  851.         If 'func1' is defined in  an  '.S'  file,  the  name  must  match
  852.  
  853.  
  854.                                      - 14 -
  855.  
  856.  
  857.         exactly.  The first leading underscore of a function name will be
  858.         removed to get exact naming matches.  Type modifiers in C  source
  859.         code  like  'cdecl' or 'pascal' will not be considered.  Remember
  860.         these conventions when processing C/FORTRAN and assembler files.
  861.  
  862.         Assembler code statements (inline code) inside C source code will
  863.         not be processed and will be skipped, because it is too difficult
  864.         to handle the several kinds of syntax being used for this    like
  865.         'asm  ...',  'asm "..."' or 'asm(...)' and the different keywords
  866.         ('asm', '_asm', '__asm', '__asm__', ...) used by various compiler
  867.         implementations.
  868.  
  869.  
  870.  
  871.  
  872.  
  873.  
  874.  
  875.  
  876.  
  877.  
  878.  
  879.  
  880.  
  881.  
  882.  
  883.  
  884.  
  885.  
  886.  
  887.  
  888.  
  889.  
  890.  
  891.  
  892.  
  893.  
  894.  
  895.  
  896.  
  897.  
  898.  
  899.  
  900.  
  901.  
  902.  
  903.  
  904.  
  905.  
  906.  
  907.  
  908.  
  909.  
  910.  
  911.  
  912.  
  913.  
  914.  
  915.                                      - 15 -
  916.  
  917.  
  918.         5    DATABASE GENERATION
  919.  
  920.         One of the most important features provided by CFT and CST is the
  921.         database generation which can be enabled with the -G  option.  It
  922.         is   performed   after  writing  the  output  file  to  save  all
  923.         informations  about  the  processed  files  in  a  set  of  dBASE
  924.         compatible database files (extension '.DBF') for later use. These
  925.         database  files  contain all necessary informations like function
  926.         or data type names,  the location where they are  defined,  their
  927.         caller/callee  relationship,  all  scanned  files  with statistic
  928.         informations, include files and so on.  It was tried to store the
  929.         informations in the most compact and effective database structure
  930.         to  save  disk  space.  Note that if the contents of the database
  931.         files is manipulated by external tools like  dBASE  or  something
  932.         else,  the  internal  consistency  will be corrupted and wrong or
  933.         unexpected results will happen!
  934.  
  935.         The database can be used to recall informations,  for example  to
  936.         find  out,  if  and  in  which  file and on which line a specific
  937.         function or data type is defined. A previously generated database
  938.         can be read into CFT and CST (option -g) to add new files  to  it
  939.         and/or  to  produce  another  output  file with new configuration
  940.         options,  for example with the reverse call tree or only  with  a
  941.         special  selected  item  of  interest  to  be displayed.  Such an
  942.         incremental database generation is also useful if large  projects
  943.         can  be  divided  into  a  set of commonly used files and project
  944.         specific files.  A good example for this is the GNU  C  compiler,
  945.         which  consists  of a set of language independent files and three
  946.         language dependent file sets  for  C,  C++  and  Objective-C.  To
  947.         analyse  this software with CFT or CST,  the language independent
  948.         part can be stored into a database which is later reused for  the
  949.         language   dependent   parts   to   build  the  complete  set  of
  950.         informations.
  951.  
  952.         The ability to retrieve informations about the sources  from  the
  953.         database  is  quite useful in many cases.  Recalling informations
  954.         from a database is much faster than processing  all  the  sources
  955.         again to find a specific item of interest.  The documentation and
  956.         maintenance of large software projects is much more effective and
  957.         easier to do if the developer has a tool to navigate through  the
  958.         source  code  and  that  helps  him  in  his comprehension of the
  959.         program and its internal structure. It is also useful for reverse
  960.         engineering of source code to get an  overview  of  the  internal
  961.         program structure.  Together with user programmable editors it is
  962.         possible to offer the user a source code browser with a hypertext
  963.         like feeling by integrating database recalling functions into the
  964.         editors.
  965.  
  966.         Two  utility  programs,   called  CFTN  and  CSTN  to,   retrieve
  967.         informations from databases, are available with supporting macros
  968.         for their integration into the BRIEF, QEDIT or MicroEMACS editor,
  969.         which are described in another section later in this manual.
  970.  
  971.  
  972.  
  973.  
  974.  
  975.  
  976.                                      - 16 -
  977.  
  978.  
  979.         6    PROGRAM LIMITATIONS
  980.  
  981.         First  of all,  CFT and CST cannot replace a compiler or a syntax
  982.         checker like 'LINT' to detect errors in  the  source  code.  This
  983.         means  that  it  should  be  possible  to compile the source code
  984.         without fatal errors before it is possible to analyse it with CFT
  985.         and CST,  otherwise the processing results may be incorrect  (and
  986.         may be the system crashes ...).
  987.  
  988.         However,  there  are  some  situations  where  CFT and CST can be
  989.         useful to detect bugs and inconsistencies in the source code like
  990.  
  991.         -    multiple definitions of functions or data types,
  992.         -    different function return types,
  993.         -    implicit declared functions with no prototype,
  994.         -    function definitions used as prototype,
  995.         -    recursive,  nested,  hidden and frequent  calls  of  include
  996.              files,
  997.         -    unclosed strings or character constants,
  998.         -    nested comments,
  999.         -    misbalanced braces,
  1000.         -    unexpected end-of-file characters inside files,
  1001.         -    illegal characters in the source code,
  1002.         -    wrong number of macro arguments,
  1003.         -    missing macro arguments,
  1004.         -    misbalanced '#if...' control blocks.
  1005.  
  1006.         These  code  checks  are  done  on  multiple  files  in  multiple
  1007.         directories so that inconsistencies between different  files  can
  1008.         be  found and displayed.  This is a capability which conventional
  1009.         compilers working only on a single file at a time cannot  provide
  1010.         and will miss therefore (maybe the linker will find some of these
  1011.         inconsistencies).
  1012.  
  1013.         Some  statistical  informations  about the source code may not be
  1014.         correct if  preprocessing  is  enabled  (-P).  This  affects  all
  1015.         options which do statistics like the -p or -s option. The size of
  1016.         the  'pure' source code may not be correct due to macro expansion
  1017.         or removing of unnecessary blanks.  However,  the  file  size  is
  1018.         always correct because it will be taken from the source file.
  1019.  
  1020.         Most  of  the  program  limitations  are  caused  by  the limited
  1021.         available memory.  This means that  the  more  conventional  main
  1022.         memory you have,  the better it is. The real mode versions of CFT
  1023.         and CST do not use expanded or extended memory, no virtual memory
  1024.         management or disk  file  swapping,  so  keep  your  conventional
  1025.         memory  free of memory consuming TSR programs and other utilities
  1026.         if you want to process a  large  number  of  files.  The  use  of
  1027.         operating  systems  like  MS-DOS  5.0  or  DR-DOS  6.0 and memory
  1028.         managers like QEMM or 386MAX to get more free conventional memory
  1029.         may help to handle big applications with a large number of files.
  1030.         If memory problems still occur during  processing,  there  is  an
  1031.         easy  way  to  break  the memory limits: use the 32 bit protected
  1032.         mode versions of CFT and CST,  called CFT386  and  CST386.  These
  1033.         programs are running in protected mode and so they have no memory
  1034.         limitations and are faster than the real mode versions.
  1035.  
  1036.  
  1037.                                      - 17 -
  1038.  
  1039.  
  1040.  
  1041.         The  number  and  the  sizes  of  files to be processed is nearly
  1042.         unlimited with 2^14 files and 2^31  bytes  maximum  file  length.
  1043.         Each  file can have 2^16 lines.  The number of functions and data
  1044.         types being handled is limited to 2^14.  Note that  these  values
  1045.         are given for the real mode versions, the protected mode versions
  1046.         exceed  them.  These  limitations  should  be enough even for the
  1047.         biggest projects that could be mentioned.
  1048.  
  1049.         The calling of nested include files is limited by the  number  of
  1050.         files  which can be opened simultaneously (operating system resp.
  1051.         compiler dependent).  The ISO/ANSI C  minimum  for  include  file
  1052.         nesting  levels  is  8,  this demand will be fulfilled by CFT and
  1053.         CST.
  1054.  
  1055.         The integrated C-preprocessor limits the size of expanded  macros
  1056.         to  6  Kbytes.  The  number  of  macros simultaneously defined is
  1057.         unlimited (ISO/ANSI: 1024) and only  affected  by  the  available
  1058.         memory.   The  number  of  macro  parameters  is  limited  to  31
  1059.         (ISO/ANSI: 31) and there are  up  to  31  significant  characters
  1060.         (ISO/ANSI:  31)  recognised.  The conditional compilation nesting
  1061.         levels of '#if...' control blocks is limited to 32 (ISO/ANSI: 8).
  1062.  
  1063.         The line length is unlimited (ISO/ANSI: logical  line  length  is
  1064.         509 characters).  The number of characters in a string (including
  1065.         '\0') is 2048 (ISO/ANSI: 509).  The  number  of  members  in  one
  1066.         structure/union  is  unlimited  (ISO/ANSI:  127),  the  number of
  1067.         structure/union nesting levels is unlimited (ISO/ANSI: 15).
  1068.  
  1069.         The recognition of identifiers like function and  variable  names
  1070.         follows  the  standard rules: an identifier consists of upper and
  1071.         lower case letters (A-Z,  a-z),  underscore (_) and digits (0-9),
  1072.         additionally  the  dollar  sign  ($)  will be accepted.  National
  1073.         character set extensions as  they  are  usual  for  languages  in
  1074.         european countries like Germany, Denmark or Sweden can be defined
  1075.         with option -J.
  1076.  
  1077.         C++  comments  '//...' are usually only recognised if option -C++
  1078.         is set.  However,  to accept the non-standard extension  of  some
  1079.         compilers which allow such comments also in C source code, option
  1080.         -// can be used therefore.  Nested C style comments '/*...*/' are
  1081.         not allowed and will always produce warnings.
  1082.  
  1083.         The calculation depth of  the  critical  function  call  path  or
  1084.         structure  nesting  level  is  unlimited.  The  calculation is an
  1085.         extremely  recursive function and was successfully tested  up  to
  1086.         115  nesting levels.  It is not known from which nesting level on
  1087.         stack overflow will happen.
  1088.  
  1089.         CFT cannot recognise and reference a function if it is used  with
  1090.         its  pure name,  without parentheses.  This happens if a function
  1091.         name is assigned to a function pointer  variable  or  used  as  a
  1092.         function pointer argument in a function call. Indirect calls to a
  1093.         function  via a function pointer cannot be resolved.  CFT will be
  1094.         confused in some rare cases by extensive type-casting  operations
  1095.         like  'void  __based(void)  *  __cdecl  ...  ()' and will display
  1096.  
  1097.  
  1098.                                      - 18 -
  1099.  
  1100.  
  1101.         unexpected messages.  A function prototype declaration  inside  a
  1102.         function block ('function given scope') will not be recognised by
  1103.         CFT.   In  assembler  source  code,  some  definitions  of  local
  1104.         variables seem to look like a function or a label definition  and
  1105.         are  treated  by CFT like that although this may be wrong in some
  1106.         cases. It is also not always possible to detect a call of a local
  1107.         label correctly.  CFT sometimes displays warning  messages  about
  1108.         'return type mismatch' though this may be correct in that special
  1109.         case  because  the  different  types  are  earlier  defined  by a
  1110.         'typedef' declaration.  The reason is  simply  that  CFT  doesn't
  1111.         recognise  these  'typedef's  (but CST does!),  it looks only for
  1112.         function names.
  1113.  
  1114.         An often requested feature for CST  is  the  integration  of  the
  1115.         calculation   of   structure/union   sizes   with   byte   offset
  1116.         informations for every structure/union member.  This  feature  is
  1117.         not  implemented  in CST although it would be possible to do this
  1118.         because all necessary informations are  present.  The  reason  is
  1119.         that  there  would  be  too  much  overhead  for CST to treat the
  1120.         various compiler implementations with their different basic  type
  1121.         sizes (sizeof(int),  sizeof(long double)) for different processor
  1122.         types (16 bit,  32 bit,  64 bit,  ...) and  data  type  alignment
  1123.         requirements  (by default and also controlled with #pragma's like
  1124.         'align' or 'pack').  It would be possible to do this for just one
  1125.         selected  compiler implementation or processor type but not for a
  1126.         great  number  of  them.   Especially  compilers   for   advanced
  1127.         architectures  like  RISC  processors  have very complicated type
  1128.         alignments rules depending on the data types,  alignment pragmas,
  1129.         compiler  switches,  type  sizes,  available  register number and
  1130.         register  sizes  and  resulting  structure/union/class  sizes  to
  1131.         generate  highly  optimised  code.   This  includes  usually  the
  1132.         insertion of 'fill' bytes inside a structure/union and  sometimes
  1133.         'padding  bytes' at the end of a structure/union to force aligned
  1134.         sizes on specific byte boundaries (For examples see the reference
  1135.         manual of the Intel 80960 C-Compiler iC960, release 3.0). Because
  1136.         of these reasons,  an integrated 'byte offset calculation' is not
  1137.         implemented in CST.  Instead,  you can generate a source file for
  1138.         selected  data  types  with  option  -O,   that  performs   these
  1139.         calculations,  if  you  compile  the  generated  file with your C
  1140.         compiler. For further informations see the description for option
  1141.         -O.
  1142.  
  1143.         SUMMARY
  1144.  
  1145.         The above described limitations can lead in  some  situations  to
  1146.         misinterpretations  or loss of informations of the scanned source
  1147.         code. The only way to avoid these lacks would be the inclusion of
  1148.         parts of a 'real compiler' to  handle  the  complete  C  and  C++
  1149.         syntax in any possible situation.  But this was not the intention
  1150.         when the development of these programs as 'little'  and  easy  to
  1151.         use general purpose programming supporting tools began.  Although
  1152.         I hope that CFT,  CST and the other SXT  programs  will  in  most
  1153.         cases be powerful and useful development and documentation tools!
  1154.  
  1155.  
  1156.  
  1157.  
  1158.  
  1159.                                      - 19 -
  1160.  
  1161.  
  1162.         7    IMPROVING EXECUTION SPEED
  1163.  
  1164.         CFT  and  CST  are disk storage based programs because the source
  1165.         and include files,  the intermediate  precompiler  file  and  the
  1166.         output  file  must  be  read from and written to hard disk.  This
  1167.         means that the execution speed of CFT and CST depends at first on
  1168.         the speed of the physical storage medium and not  (only)  on  the
  1169.         speed  of the CPU.  There are several ways to improve the program
  1170.         performance:
  1171.  
  1172.         -    install a RAM-disk and
  1173.              a)   start CFT and CST from there so that  the  intermediate
  1174.                   file and the resulting output file will be stored there
  1175.                   (but  don't  forget to copy the output file to the hard
  1176.                   disk before power-off), or
  1177.              b)   use the -v option  to  redirect  only  the  precompiler
  1178.                   output  file  (scanner input file) to the RAM-disk from
  1179.                   anywhere the program is started (the RAM-disk  must  be
  1180.                   large  enough  to  hold  the largest possible temporary
  1181.                   file, otherwise a disk-write error will occur),
  1182.         -    use a hard disk cache program like SmartDrive,  HyperDisk or
  1183.              PC-Cache,
  1184.         -    use a faster hard disk,
  1185.         -    and finally, of course, use a faster and more powerful CPU.
  1186.  
  1187.         The  most  effective  combination is option -v with a RAM-disk as
  1188.         destination path and hard disk caching together with a fast  hard
  1189.         disk drive. If the disk cache is large enough to hold most of the
  1190.         frequently called include files, the execution speed is about 2.5
  1191.         to  3  times faster than without.  This is a significant speed-up
  1192.         especially for projects with a large number  of  files  and  many
  1193.         included files in each source file.
  1194.  
  1195.         During program execution with preprocessing (option -P),  most of
  1196.         the time will be consumed to preprocess the given input files and
  1197.         the related include files and to generate the preprocessor output
  1198.         file.  The scanning for functions (CFT) or data types (CST) takes
  1199.         only a small amount of time. The function/data type relations are
  1200.         computed while the output is generated and written to disk, there
  1201.         is no precomputing necessary.
  1202.  
  1203.         The  function  for  critical  call  path/nesting  level detection
  1204.         depends only on the number of functions or structures and not  on
  1205.         the call/declaration nesting complexity. The execution time grows
  1206.         linear with the number of items (functions/structures) to process
  1207.         and is very fast!
  1208.  
  1209.         Be  aware  of  the  fact that the processing of a large number of
  1210.         files can take quite a long time  (from  several  minutes  up  to
  1211.         hours  on  lower performance machines!),  especially if option -P
  1212.         for preprocessing is enabled.
  1213.  
  1214.         The generation of the output file and writing to  disk  can  also
  1215.         take some time if the number of items to display is large and the
  1216.         nesting  structure  is  complex or if there is no cross reference
  1217.         option enabled (see -x and -r for further  information).  If  the
  1218.  
  1219.  
  1220.                                      - 20 -
  1221.  
  1222.  
  1223.         number  of  items  is very large,  one of the most time consuming
  1224.         options is the function/data type file reference (option -z). The
  1225.         writing and reading of the database files  (options  -G  and  -g)
  1226.         takes  also  some  time  due  to  the  large  number of different
  1227.         informations.
  1228.  
  1229.         Don't panic if there seems to be no  disk  access  for  a  longer
  1230.         time,  the  reason  is  just  that  there  may  be time consuming
  1231.         computations and that the output will be buffered  internally  to
  1232.         reduce  the  number  of  disk accesses and therefore speed up the
  1233.         output!
  1234.  
  1235.         For more detailed informations about the program  efficiency  see
  1236.         appendix 3.
  1237.  
  1238.  
  1239.  
  1240.  
  1241.  
  1242.  
  1243.  
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.  
  1261.  
  1262.  
  1263.  
  1264.  
  1265.  
  1266.  
  1267.  
  1268.  
  1269.  
  1270.  
  1271.  
  1272.  
  1273.  
  1274.  
  1275.  
  1276.  
  1277.  
  1278.  
  1279.  
  1280.  
  1281.                                      - 21 -
  1282.  
  1283.  
  1284.         8    COMMAND LINE SYNTAX DESCRIPTION
  1285.  
  1286.         The  SXT  programs are command-line driven.  This section gives a
  1287.         complete overview  about  all  command  line  options  and  their
  1288.         syntax.  It  gives  also  remarks for their use and shows several
  1289.         examples with detailed descriptions. The command line options are
  1290.         case-sensitive!  There are no differences between the  real  mode
  1291.         and the other versions of the SXT programs.  For every option the
  1292.         SXT programs which support it are  listed  in  parentheses.  This
  1293.         section  of  the documentation should be read very careful by all
  1294.         users to get a complete overview about all the features which are
  1295.         provided.
  1296.  
  1297.         THE OPTIONS ARE LISTED IN LEXICOGRAPHICAL ORDER.
  1298.         NONE OF THE OPTIONS IS SET BY DEFAULT.
  1299.  
  1300.         SYNTAX:   CFT [options [$cmdfile]] <[+]file> <@filelist>
  1301.                   CST [options [$cmdfile]] <[+]file> <@filelist>
  1302.                   DFT [options [$cmdfile]] <[+]file> <@filelist>
  1303.                   FFT [options [$cmdfile]] <[+]file> <@filelist>
  1304.                   LFT [options [$cmdfile]] <[+]file> <@filelist>
  1305.  
  1306.  
  1307.         OPTIONS:       (valid for)
  1308.  
  1309.         -Bsizes        (CFT, CST)
  1310.         Redefine the basic type sizes and pointer type sizes (all  values
  1311.         must  be declared in bytes) for conditional preprocessor controls
  1312.         with the 'sizeof()' keyword like '#if  sizeof(int)  ==  4'.  This
  1313.         option is only valid with the -P option.
  1314.  
  1315.         The required format for this option is
  1316.  
  1317.              -Bv,c,s,i,l,f,d,ld*data,code
  1318.                                |
  1319.              (delimiter between data and pointer sizes is '*')
  1320.  
  1321.         with  the  following types and their respective default data size
  1322.         values in bytes (the pointer type sizes are model dependent):
  1323.  
  1324.         v    :    void (sizeof(void) is usually 0, but for GNU-C it is 1)
  1325.         c    :    char (1 byte)
  1326.         s    :    short (by definition 2 bytes, hardware independent)
  1327.         i    :    integer (hardware dependent, 2 or 4 bytes)
  1328.         l    :    long (4 bytes)
  1329.         f    :    float (4 bytes, IEEE format)
  1330.         d    :    double (8 bytes, IEEE format)
  1331.         ld   :    long double (10  bytes,  IEEE  format,  some  compilers
  1332.                   assume  long  double == double (= 8 bytes),  some CPU's
  1333.                   and their compilers have special alignment requirements
  1334.                   like the Intel 80960,  where sizeof(long double) is  16
  1335.                   bytes  due  to  register and memory access requirements
  1336.                   and structure alignment)
  1337.         data :    data pointer (type pointers, 2 or 4 bytes, memory model
  1338.                   dependent)
  1339.  
  1340.  
  1341.  
  1342.                                      - 22 -
  1343.  
  1344.  
  1345.         code :    code pointer (function pointers,  2 or 4 bytes,  memory
  1346.                   model dependent)
  1347.  
  1348.         The  sizes  of  signed and unsigned types of the same basic types
  1349.         are considered equal, this means that, for example, the following
  1350.         expression is true:
  1351.  
  1352.              sizeof(unsigned int) == sizeof(signed int) == sizeof(int)
  1353.  
  1354.         The sizes of type pointers to data and function pointers to  code
  1355.         are  also  considered equal,  this means that,  for example,  the
  1356.         following expressions are true:
  1357.  
  1358.              sizeof(int *) == sizeof(float *)
  1359.              sizeof(int (*)()) == sizeof(float (*)())
  1360.  
  1361.         A 64 bit (8 bytes) integer type like 'long long' or 'bigint'  (or
  1362.         something else) is not supported because there are no C compilers
  1363.         known  to  me which use such a type although some (co-)processors
  1364.         and their assemblers are able  to  handle  it  (see  Intel  80960
  1365.         assembler manual for examples).
  1366.  
  1367.         If  the -B option is not set,  the default values for the various
  1368.         memory models and compiler types (as they are known  to  me)  are
  1369.         used,   the   assumed   target   hardware   has  an  Intel  80x86
  1370.         microprocessor.  Note that during preprocessing type modificators
  1371.         like "near" or "far" are not recognised.
  1372.  
  1373.         If  the  -B  and  the  -T options are not set,  the sizes of data
  1374.         pointers and code pointers are always considered equal:
  1375.  
  1376.              sizeof(int *) == sizeof(int (*)())      (= 4, large model)
  1377.  
  1378.         For  example,   -B0,1,2,2,4,4,8,10*4,4  would  be   the   correct
  1379.         declaration  for  MS-C  7.0,  large/huge  memory model,  with the
  1380.         values for data types (void = 0,  char = 1,  short = 2,  int = 2,
  1381.         long = 4,  float = 4, double = 8 and  long double = 10 bytes) and
  1382.         pointers to data  types  and  function  pointers  (all  values  4
  1383.         bytes).  These values are set automatically by defining -TMSC70,L
  1384.         (or -TMSC70,H) as compiler type and memory model description  for
  1385.         preprocessing.
  1386.  
  1387.         -C++           (CFT, CST)
  1388.         Enable C++ source code processing.  This includes the handling of
  1389.         C++ comments '//...',  the recognition of C++  keywords  and  the
  1390.         definition of the macro name '__cplusplus' for preprocessing.  If
  1391.         a  supported  compiler  defines  additional  macro   names   like
  1392.         '__TCPLUSPLUS__'  for  Turbo-C  they  will also be defined before
  1393.         preprocessing.  Option -C++ is strictly required to  process  C++
  1394.         code correct.
  1395.  
  1396.         -C[s]          (CFT, CST, DFT, FFT, LFT)
  1397.         List  the  function/data  type contents for every processed file,
  1398.         's' sorts by line numbers (DEFAULT ORDER: lexicographical). There
  1399.         are additional informations possible  with  the  option  -s.  CFT
  1400.         informs if none of the functions defined in a file is called from
  1401.  
  1402.  
  1403.                                      - 23 -
  1404.  
  1405.  
  1406.         functions  defined  in  other  files  (internal  versus  external
  1407.         linkage). Functions for which no external caller outside the file
  1408.         is found will be marked [INTERNAL], such functions are candidates
  1409.         for defining them as 'static'. Attention: Calling a function by a
  1410.         function pointer won't be noticed!  This information is useful to
  1411.         find  out  whether  the contents of a file is unnecessary for the
  1412.         project so that the file must not be linked.  This  option  gives
  1413.         useful  informations  about source code metrics for every defined
  1414.         function.
  1415.  
  1416.         -D[..]         (CFT, CST, DFT, FFT, LFT)
  1417.         Specifies macro name(s) (-Dname or -Dname1=name2)  or  file  with
  1418.         macro names (-D@namelist) of functions/data types which should be
  1419.         predefined and linked together,  also used as preprocessor define
  1420.         if the integrated preprocessor is called (-P).  The defined names
  1421.         are case sensitive and trigraph translation is performed on them.
  1422.  
  1423.         The  definition  of  a  string as replacement for a macro name is
  1424.         different on the command line and inside a macro definition  file
  1425.         or  command  file  (marked  with '$').  On the command line,  the
  1426.         double quotation marks must be 'escaped' and the string  must  be
  1427.         quoted  like  '-DXYZ="\"123\""'  (similar  to  C strings) to work
  1428.         correctly,  the reason is  the  DOS  wildcard  expansion  of  the
  1429.         command  line.  Inside  a  macro definition or command file,  the
  1430.         double quotation marks need not be 'escaped',  so the  definition
  1431.         can be written like '-DXYZ="123"'.  This option cannot be used in
  1432.         environment defines if the equal sign '=' is  used  because  this
  1433.         produces  a syntax error for DOS when trying to store a 'SET=...'
  1434.         command with a second equal sign in one line.  If a  define  item
  1435.         consists  of  two  words  see  the  notes  at  option  -S  for  a
  1436.         description.  Keep these differences and exceptions  in  mind  to
  1437.         avoid unexpected results using the -D option.
  1438.  
  1439.         -Ename         (CFT, CST, FFT)
  1440.         Almost the same as -I, but the path for the include files will be
  1441.         taken  from  the  environment  variable 'name'.  Typing -EINCLUDE
  1442.         would produce the same results as -I alone.
  1443.  
  1444.         -E[..]         (LFT)
  1445.         Specifies name(s) (-Ename) or file with  names  (-E@namelist)  of
  1446.         external  (builtin)  functions.  Useful  if GNU-Emacs Lisp source
  1447.         code is scanned to  reduce  the  number  of  undefined  functions
  1448.         listed  in  the output file.  A list of GNU-EMACS (version 18.59)
  1449.         builtin functions is given with the file GNULISP.FCT.
  1450.  
  1451.         -F             (CFT, CST, DFT, FFT, LFT)
  1452.         Use only ASCII characters for the tree chart  output  instead  of
  1453.         the DEFAULT semigraphic characters.  This option is useful if the
  1454.         generated output file should be printed on a printer  which  does
  1455.         not  support  semigraphic characters like they are defined in the
  1456.         IBM character set. It can also be used to prepare the output file
  1457.         for use in a WINDOWS application like MicroEMACS if there  is  no
  1458.         font with semigraphics available.
  1459.  
  1460.  
  1461.  
  1462.  
  1463.  
  1464.                                      - 24 -
  1465.  
  1466.  
  1467.         -G[name]       (CFT, CST, DFT, FFT, LFT)
  1468.         Generate  a  database with the complete set of informations about
  1469.         the processed sources.  The additional parameter 'name' (path and
  1470.         file name) is used as an unique base name for the set of database
  1471.         files (up to 6 significant characters), the DEFAULT NAME 'CXT' is
  1472.         used if no name is specified. If 'name' ends with a (back-)slash,
  1473.         it is used as a pathname. The generated database files (extension
  1474.         '.DBF')  are  dBASE  compatible.  There  are two additional files
  1475.         created, one with the command line options (extension '.CMD') and
  1476.         one with a list of the source files (extension '.SRC') being  use
  1477.         for  database  generation.  They  can  be  used  as  command line
  1478.         definition files with '$' (command list) and '@' (file list).
  1479.  
  1480.         As a result of the database generation you will find files  named
  1481.         'CXTxy.ext'  (default name 'CXT') respectively 'namexy.ext' (user
  1482.         defined 'name'), where 'x' will be 'F' for CFT or 'S' for CST and
  1483.         'y' is replaced by an  internally  used  character  to  mark  the
  1484.         different database files and their contents.
  1485.  
  1486.         -H[elp]        (CFT, CST, DFT, FFT, LFT)
  1487.         See option -?.
  1488.  
  1489.         -I[path]       (CFT, CST, FFT)
  1490.         This  option  enables the scanning of include files declared with
  1491.         '#include "..."' or '#include <...>' or with a similar syntax for
  1492.         FORTRAN.  The required path for the include files is  taken  from
  1493.         the  INCLUDE  environment  variable (DEFAULT BEHAVIOUR) or can be
  1494.         user defined by 'path'.  Paths defined with -I will  be  searched
  1495.         before any other paths taken from environment variables specified
  1496.         by  -E or -P,  so care should be taken with that option.  Include
  1497.         paths can be given either absolute or relative.  A relative  path
  1498.         is always considered relative to the directory of the source file
  1499.         it  is  used  with,  not to the directory the analysis is started
  1500.         from or the analysis program is located.  Specifying -I*  ignores
  1501.         missing include files during preprocessing (-P). This is a 'quick
  1502.         and  dirty'  approach,  but  can sometimes be useful,  if include
  1503.         interrelations or locations are unknown. However, the results may
  1504.         not always be correct.
  1505.  
  1506.         Using the -I or -E option without -P allows the scanning  of  the
  1507.         source file and the included files without preprocessing. In that
  1508.         case  an  include  file  is  handled as if it were a complete new
  1509.         file,  this can lead to errors if a file inclusion  is  specified
  1510.         within  a function or structure.  Also preprocessor controls like
  1511.         '#if ...' are not evaluated and can lead to unexpected results.
  1512.  
  1513.         -Jcharset      (CFT, CST, DFT, FFT, LFT)
  1514.         Extend the C/C++ character set (a-z, A-Z, 0-9,  _,  $),  which is
  1515.         used  by DEFAULT,  for identifier recognition with a user defined
  1516.         character set 'charset'. This option allows the programmer to use
  1517.         national character sets as they are common in  Germany,  Denmark,
  1518.         Sweden  and  other  european  countries.  All  characters must be
  1519.         specified within one -J option.
  1520.  
  1521.  
  1522.  
  1523.  
  1524.  
  1525.                                      - 25 -
  1526.  
  1527.  
  1528.         -L[L][+]       (CFT, CST, DFT, FFT, LFT)
  1529.         Redirect the screen output to  a  file,  called  'CFT.LOG'  resp.
  1530.         'CST.LOG'.  If  '+' is set,  the output is both written to screen
  1531.         and redirected to the log file so that the  output  messages  can
  1532.         both  be viewed as they appear and later analysed.  Finally,  -LL
  1533.         resp.  -LL+ appends the output to an existing file,  this can  be
  1534.         useful if CFT and CST run in batch jobs.
  1535.  
  1536.         -M             (CFT, CST, FFT)
  1537.         This option generates a source file/include file dependency table
  1538.         for every processed file.  This table shows the dependent include
  1539.         files of a source file and can be used for a  MAKE  file.  It  is
  1540.         also  useful  to  check  if the included files are taken from the
  1541.         correct directories.  If a file is included more than  once,  the
  1542.         number of inclusions will be displayed.
  1543.  
  1544.         -N             (CFT, CST, DFT, FFT, LFT)
  1545.         Disable the writing of an output file.  This option can be useful
  1546.         if, for example,  only a database (option -G) should be generated
  1547.         with CFT or CST and no output file is required.  In that case the
  1548.         sometimes very time consuming process of output file  writing  is
  1549.         skipped.  Note  that  for CST the writing of the byte offset file
  1550.         "CST_OFFS.C" will not be affected by this option.
  1551.  
  1552.         -O[..]         (CST)
  1553.         Specifies name(s) (-Oname) or file with  names  (-O@namelist)  of
  1554.         data  types  for  which  the calculation of structure/union sizes
  1555.         with byte offset informations for every data type  member  should
  1556.         be  performed.  Additionally  specifying  -O+ sets a flag for the
  1557.         recursive collection of sub-structures during expansion which are
  1558.         displayed without specifying them by -O.  This means  that  if  a
  1559.         structure/union  consists of members which are also structures or
  1560.         unions (and so on), it is not necessary to specify all these data
  1561.         type names with -O to enable them for  byte  offset  calculation.
  1562.         Instead,  you  have  to  specify only the top most data type with
  1563.         -Oname and additionally -O+ to force CST to  select  all  related
  1564.         sub-types  for  displaying.  If  -O+  is  set  but  NO  names are
  1565.         specified, ALL structures and unions will be used for byte offset
  1566.         calculations!
  1567.  
  1568.         As the result of this option,  CST generates  a  C  source  file,
  1569.         called  'CST_OFFS.C'.  This file needs some additional editing to
  1570.         declare necessary include files,  data types,  defines or pragmas
  1571.         before  it can be compiled with the C compiler for which the file
  1572.         was generated (be sure to use the same includes!).  The resulting
  1573.         executable  prints  for  every  structure/union  member  the byte
  1574.         offset relative to the beginning of the structure/union  (decimal
  1575.         and  hexadecimal)  and  the  size  of each member,  the resulting
  1576.         structure/union   size   and   also   informations   whether    a
  1577.         structure/union  member  has  been  aligned (= compiler dependent
  1578.         insertion  of  fill  bytes  before  that  member)   or   if   the
  1579.         structure/union  was  padded  with fill bytes at the end of it to
  1580.         align the size to a specific length.
  1581.  
  1582.  
  1583.  
  1584.  
  1585.  
  1586.                                      - 26 -
  1587.  
  1588.  
  1589.         To  get  these  informations  and  to   perform   the   necessary
  1590.         calculations  therefore,  the source file 'CST_OFFS.C' can become
  1591.         very large and makes use of the C macro programming capabilities,
  1592.         which  may  lead  in  some  rare  cases  to  errors  during   the
  1593.         compilation due to the internal limitations of some C compilers.
  1594.  
  1595.         The  -O  option  is very useful if you need detailed informations
  1596.         about structures/unions in case of error searching and debugging,
  1597.         especially for hardware debugging with an ICE.  It is also useful
  1598.         for  finding  out  the  differences  in  the internal layout of a
  1599.         structure/union in the case of  porting  C  source  code  between
  1600.         different   compilers   and/or   operating  systems  or  if  data
  1601.         structures are exchanged between  different  hardware  platforms,
  1602.         for  example  with  data  communication.  You  can  verify if the
  1603.         expected structure/union layout and size is  really  produced  by
  1604.         the target compiler.
  1605.  
  1606.         -P[name]       (CFT, CST)
  1607.         Run  the integrated C preprocessor before the file scan.  In this
  1608.         case the include path  is  taken  from  the  INCLUDE  environment
  1609.         variable  (DEFAULT  BEHAVIOUR),  from  the  user  defined  'name'
  1610.         environment and additional paths from -I and -E option are  used.
  1611.         If  special  paths  should  be searched before the default paths,
  1612.         they must be specified by the  -I  path  or  the  -E  environment
  1613.         option  and they must be placed on the command line before the -P
  1614.         option to be processed first. The -D, -U preprocessor defines and
  1615.         -T type and memory model and -B size  infos  are  also  used,  if
  1616.         defined.  The  path  for  the  preprocessor  output  file  can be
  1617.         specified  by  the  -v  option,  otherwise  the  current  working
  1618.         directory  will be used (DEFAULT BEHAVIOUR).  The comments in the
  1619.         source and included files will remain  until  -q  is  defined  to
  1620.         remove them. The comments are used for statistics with option -p.
  1621.         If option -C++ is set, the macro '__cplusplus' will be predefined
  1622.         before  preprocessing  to  enable  C++  macros  and  C++  comment
  1623.         recognition.
  1624.  
  1625.         If you are using a compiler which is not supported by CFT and CST
  1626.         or the build-in preprocessing doesn't satisfy your needs  because
  1627.         the results seem to be different from your preprocessor,  you can
  1628.         preprocess the files you want to analyse with your  own  compiler
  1629.         preprocessor  and  use  these preprocessed files as input for CFT
  1630.         and CST.
  1631.  
  1632.         -R             (CFT, CST, DFT, FFT, LFT)
  1633.         By default,  CFT and CST generate the hierarchy tree chart of the
  1634.         called function/data type ("CALLER:CALLEE relation",  "WHO CALLES
  1635.         WHOM").  The -R option produces an inverted listing  showing  the
  1636.         callers/users of each function/data type. It generates the output
  1637.         as  the  function/data  type  hierarchy member list tree chart in
  1638.         reverse order as a list of calling items of the referenced  basic
  1639.         item  ("CALLEE:CALLER relation",  "WHO IS CALLED BY WHOM").  This
  1640.         option is useful to  get  the  relations  between  functions/data
  1641.         types and their callers/users.
  1642.  
  1643.  
  1644.  
  1645.  
  1646.  
  1647.                                      - 27 -
  1648.  
  1649.  
  1650.         -RATIONAL      (CFT, CST, DFT, FFT, LFT)
  1651.         This  option generates a so called 'Petal' file for Rational Rose
  1652.         2.0  for  MS-Windows  3.1,   a  CASE-tool  supporting  the  Booch
  1653.         Object-Oriented Analysis and Design (OOAD) method.  The generated
  1654.         output file can be imported by Rational Rose to use  the  builtin
  1655.         capabilities for describing and visualizing Finite State Machines
  1656.         (FSM),  but  in this case (mis-)used to graphically visualize the
  1657.         calling relationships of functions resp. data types.  If you have
  1658.         Rational Rose 2.0, you have to perform the following steps to get
  1659.         impressive  results:  Start  Rational Rose and select a new model
  1660.         ('File'  -  'New')  and  import  the  generated  file  ('File'  -
  1661.         'Import...').  If  successful,  a  class  diagram  with one class
  1662.         symbol named 'CallGraph' appears. Click on that symbol and choose
  1663.         'Browse' - 'State Diagram'. In the state diagram select 'Tools' -
  1664.         'Layout' to start the layout optimization function. As the result
  1665.         the graphical call tree of the source code analysis is  displayed
  1666.         with  each function/data type shown as a circle ('state') and the
  1667.         call relationship shown as  an  arrow  ('transaction')  from  the
  1668.         calling  to  the called item,  for classes from the superclass to
  1669.         the subclass. You can zoom into the diagram, print the results or
  1670.         incorporate the diagrams  into  your  program  documentation  via
  1671.         Clipboard, e.g. into MS-Word-for-Windows.
  1672.  
  1673.         This  option  is  available  for all SXT programs.  The generated
  1674.         files are named 'CFT.PTL',  'CST.PTL',  'DFT.PTL' and so on.  CST
  1675.         generates  an additional file named 'CSTCLASS.PTL' describing the
  1676.         class  inheritance  relationships.  The  -RATIONAL  option  is  a
  1677.         work-around  for the missing graphical layout capabilities of the
  1678.         SXT programs (which some users have requested  in  the  past)  by
  1679.         using  an  external program for doing the missing features.  This
  1680.         option was tested with Rational Rose 2.0 Beta for MS-Windows 3.1.
  1681.         Note that Rational Rose needs even for  small  and  medium  sized
  1682.         projects some time to import the file and process the FSM layout.
  1683.  
  1684.         -S[..]         (CFT, CST, DFT, FFT, LFT)
  1685.         Specify  name  (-Sname)  or  file  with  names  (-S@namelist)  of
  1686.         functions/data types to search for and to dump if present,  names
  1687.         are  case  sensitive.  These items are listed first in the output
  1688.         tree chart file. By using -S on the command line, it is necessary
  1689.         to surround a data type name that  consists  of  two  words  with
  1690.         double  quotation  marks  like "struct _iobuf" to connect the two
  1691.         words. This is not necessary inside a list file,  but there every
  1692.         search name must be on a separate line.
  1693.  
  1694.         -Tn            (FFT)
  1695.         Set the tabulator expansion size to 'n' (DEFAULT: 8 characters).
  1696.  
  1697.         -Ttype,m       (CFT, CST)
  1698.         Use  this  option  to  set  the  compiler  type  for  source code
  1699.         preprocessing to one of the following types:
  1700.  
  1701.              MSC51     Microsoft C 5.1
  1702.              MSC70     Microsoft C/C++ 7.0
  1703.              MSVCWNT   Microsoft VC++ 1.0 for Windows NT
  1704.              TC10      Borland Turbo C++ 1.0
  1705.              BC20      Borland C++ 2.0
  1706.  
  1707.  
  1708.                                      - 28 -
  1709.  
  1710.  
  1711.              BC31      Borland C++ 3.1
  1712.              BC10OS2   Borland C++ 1.0 for OS/2
  1713.              GNU       GNU-C
  1714.              I960      Intel 80960 iC960 3.0
  1715.  
  1716.         The supported memory models are T(iny)  (valid  only  for  MSC70,
  1717.         TC10, BC20, BC31), S(mall), M(edium), C(ompact), L(arge), H(uge),
  1718.         'L'  is assumed as default if no model is specified.  MS VC++ for
  1719.         Windows NT,  Borland C++ for OS/2,  GNU-C and Intel iC960 do  not
  1720.         need a memory model because they compile really 32 bit code.  The
  1721.         Intel iC960 compiler requires the definition of  the  80960  RISC
  1722.         processor architecture which is one of KA,  KB,  SA,  SB,  MC, CA
  1723.         (default is KB).
  1724.  
  1725.         This option causes several compiler dependent preprocessor macros
  1726.         (if they  were  known  to  me,  however)  to  be  defined  before
  1727.         preprocessing  starts.  This  option can only be used with the -P
  1728.         option, otherwise it has no effect.
  1729.  
  1730.         If your compiler is not supported,  you can perform the following
  1731.         steps: Find out which preprocessor defines are necessary (manual,
  1732.         help  file)  and  declare  them  with  option  -D,  then declare,
  1733.         depending on the selected memory model or processor architecture,
  1734.         the type sizes with option -B.
  1735.  
  1736.         -U[..]         (CFT, CST)
  1737.         Specifies  a  predefined  macro  name  (-Dname)  or   file   with
  1738.         predefined   macro   names  (-U@namelist)  to  be  undefined  for
  1739.         preprocessing.  Note that  the  default  predefined  macro  names
  1740.         '__FILE__',   '__LINE__',   '__DATE__',   '__TIME__'   cannot  be
  1741.         undefined.  All other predefined names for the  various  compiler
  1742.         types  can  be undefined.  Like for -D,  the names are considered
  1743.         case-sensitive, but trigraph translation is not performed because
  1744.         the internal representation cannot contain trigraphs.
  1745.  
  1746.         -V             (CFT)
  1747.         List prototyped functions which are neither  called  nor  defined
  1748.         (option -a and -u). This option is useful to find unused function
  1749.         prototypes which could be removed from the source code.
  1750.  
  1751.         -Wlevel        (CFT, CST, DFT, FFT, LFT)
  1752.         Set  error  and  warning  message  level.  Higher  warning levels
  1753.         include lower ones.  The DEFAULT  level  is  always  the  highest
  1754.         supported warning level: Possible levels are:
  1755.  
  1756.         0 :  all   error  and  warning  messages  are  suppressed  except
  1757.              absolutely catastrophic fatal errors,
  1758.         1 :  display serious errors or warnings,
  1759.         2 :  includes level 1 plus additional errors and warnings,
  1760.         3 :  includes level 2 plus errors/warnings/remarks,
  1761.         4 :  includes level  3  plus  warnings  about  implicit  declared
  1762.              functions and lacks of type or storage class.
  1763.  
  1764.  
  1765.  
  1766.  
  1767.  
  1768.  
  1769.                                      - 29 -
  1770.  
  1771.  
  1772.         The following levels affect only preprocessing (CFT and CST):
  1773.  
  1774.         5 :  includes   level   4   plus   warnings   and  errors  during
  1775.              preprocessing  (non-fatal   errors   and   warnings   during
  1776.              preprocessing  are otherwise not displayed,  preprocessor is
  1777.              running in 'silent mode'),
  1778.         6 :  includes  level  5  plus  remarks/slight   warnings   during
  1779.              preprocessing.
  1780.  
  1781.         The output format for messages during file scan is
  1782.  
  1783.              file name(line): error: description
  1784.              file name(line): warning: description
  1785.  
  1786.         and during preprocessing (warning levels 5 and 6)
  1787.  
  1788.              preprocessor: file name(line): error: description
  1789.                   source line
  1790.              preprocessor: file name(line): warning: description
  1791.                   source line
  1792.  
  1793.         -X             (CFT, CST, DFT, FFT, LFT)
  1794.         Assume  a  UNIX-style  text  file:  no CR,  only LF.  The DEFAULT
  1795.         ASSUMPTION is  a  DOS-style  text  file  with  CR+LF.  Any  other
  1796.         combination like CR in UNIX-files,  CR without following LF or LF
  1797.         without preceding CR in DOS-files will cause a  warning  message.
  1798.         This  option  is  useful  to  detect  possible  conversion errors
  1799.         between  different  operating   systems   or   incorrect   editor
  1800.         configuration settings.
  1801.  
  1802.         -XLAMBDA       (LFT)
  1803.         Recognize  the  LISP  resp.  SCHEME  keyword 'lambda' for unnamed
  1804.         function declarations.  By DEFAULT,  'lambda'  is  treated  as  a
  1805.         simple identifier.
  1806.  
  1807.         -XSCHEME       (LFT)
  1808.         Assume  SCHEME source code instead of LISP source code (DEFAULT).
  1809.         This means that functions are recognised by the  'define'  SCHEME
  1810.         keyword instead of the 'defun' resp. 'defmacro' LISP keywords.
  1811.  
  1812.         -Y             (CFT, CST, DFT, FFT, LFT)
  1813.         Ignore  CR+LF  checks.  This option disables all checks which are
  1814.         done for unexpected CR+LF combinations in DOS or UNIX  files.  If
  1815.         option -Y is set,  option -X will be ignored.  This option can be
  1816.         useful if there would be too many messages concerning that  error
  1817.         or if this message would be of no interest for the user.
  1818.  
  1819.         -Z[s]          (CFT, CST, DFT, FFT, LFT)
  1820.         Display every caller and member for each function/data type,  's'
  1821.         sorts by the number of calls  (DEFAULT  ORDER:  lexicographical),
  1822.         this  is  an  extension  of the -c option.  This option shows the
  1823.         relations in the following form:
  1824.  
  1825.              List of parent functions/data types:
  1826.              1. caller (reference #) <# of calls from>
  1827.              ...
  1828.  
  1829.  
  1830.                                      - 30 -
  1831.  
  1832.  
  1833.              n. caller ...
  1834.         function/data type (reference #) <# of calls from parents,  #  of
  1835.         calls to children>
  1836.              List of child functions/data types:
  1837.              1. called member (reference #) <# of calls to>
  1838.              ...
  1839.              m. called member ...
  1840.  
  1841.         This  compact  form lists all callers and members with the number
  1842.         of their calls, recursions are detected and displayed.
  1843.  
  1844.         -a             (CFT, CST, DFT, FFT, LFT)
  1845.         List  every  function/data  type,   also  previously   referenced
  1846.         functions/data  types.  This  generates  a complete list of every
  1847.         function/data type in lexicographical order  with  references  to
  1848.         their first location.
  1849.  
  1850.         -b             (CST)
  1851.         Display  the  C++  class  inheritance relationships.  This option
  1852.         generates two listings.  The first one displays the complete  C++
  1853.         class  hierarchy  graph(s).  The  second one shows for each class
  1854.         first the superclasses from which  the  class  inherits  and  the
  1855.         access restrictions (public,  protected, virtual, ...) and second
  1856.         the subclasses which inherit from  the  given  class,  also  with
  1857.         access  restrictions.  This  option  is useful to find out things
  1858.         like the class dependencies or multiple inheritance.
  1859.  
  1860.         -cmdline       (CFT, CST, DFT, FFT, LFT)
  1861.         Print the command line options at the  beginning  of  the  output
  1862.         file  as  a  remark for the generation rules of that output file.
  1863.         The contents of commandlist and filelist files is indented  after
  1864.         the listfile name.
  1865.  
  1866.         -c[s]          (CFT, CST, DFT, FFT, LFT)
  1867.         Display the number of calls to each function/data type, 's' sorts
  1868.         by  the number of calls (DEFAULT ORDER: lexicographical).  Useful
  1869.         to find out which  functions/data  types  are  never  called/used
  1870.         (maybe  unnecessary  and  deletable)  and which ones are the most
  1871.         frequently called/used (together with profiler results a  subject
  1872.         for further optimization efforts).
  1873.  
  1874.         -dn            (CFT, CST, DFT, FFT, LFT)
  1875.         Set the maximum function/structure/union nesting level for output
  1876.         generation  to  'n' (DEFAULT: maximum value n = 999).  This means
  1877.         that the request for displaying a deeper level will  be  rejected
  1878.         and the output tree chart will be truncated at the given level.
  1879.  
  1880.         -e[char]       (CFT, CST, DFT, FFT, LFT)
  1881.         Generate  formatted ASCII text files with function/data type list
  1882.         and file list.  All entries are separated by the optional  'char'
  1883.         character,  if 'char ' is not defined, the tabulator character is
  1884.         used as DEFAULT SEAPRATOR.  If spaces are  wanted  as  separating
  1885.         characters,  you have to write -e" ".  Such prepared files can be
  1886.         used directly as input to other  programs  like  word  processors
  1887.  
  1888.  
  1889.  
  1890.  
  1891.                                      - 31 -
  1892.  
  1893.  
  1894.         (e.g.  MS-WORD  for  WINDOWS)  or  spreadsheet  calculators (e.g.
  1895.         MS-EXCEL), for example for documentation purposes.  The following
  1896.         files are created:
  1897.  
  1898.         CFTITEMS.TXT:
  1899.         Contents: function name,  return type, file name, line #, total #
  1900.         of function bytes,  # of function comment bytes,  #  of  function
  1901.         lines, # of control statements, # of brace levels
  1902.  
  1903.         CSTITEMS.TXT:
  1904.         Contents: data type name, file name line #
  1905.  
  1906.         CFTFILES.TXT and CSTFILES.TXT:
  1907.         Contents: file name, # of lines, file size in bytes, # of comment
  1908.         bytes, # of functions/data types
  1909.  
  1910.         -f             (CFT, CST, DFT, FFT, LFT)
  1911.         Generate   an   output   list  in  short  form,   only  with  the
  1912.         function/data type names,  no further description of the internal
  1913.         function/data type elements.
  1914.  
  1915.         -g[name]       (CFT, CST, DFT, FFT, LFT)
  1916.         Read  a  previously  generated  database  (see  option  -G).  The
  1917.         additional parameter 'name' (path and file name) is  used  as  an
  1918.         unique  base  name  for  the  set  of  database  files  (up  to 6
  1919.         significant characters),  the DEFAULT NAME 'CXT' is  used  if  no
  1920.         name is specified. If 'name' ends with a (back-)slash, it is used
  1921.         as  a  pathname.  Every source file will be tested for changes of
  1922.         file creation time and file size and a warning  message  will  be
  1923.         given to inform the user.
  1924.  
  1925.         -h[elp]        (CFT, CST, DFT, FFT, LFT)
  1926.         See option -?.
  1927.  
  1928.         -iname         (CFT, DFT, FFT, LFT)
  1929.         Ignore  function member 'name' in output tree chart.  It will not
  1930.         be displayed and will be skipped instead if found as  a  function
  1931.         member.  This option can be useful if, for example, functions are
  1932.         used only for test purposes and are of no  further  interest  for
  1933.         the user and should be ignored in the output tree chart.
  1934.  
  1935.         -l             (CFT, DFT, FFT, LFT)
  1936.         List  a  function only once in case of repeated consecutive calls
  1937.         (DEFAULT: display every occurence).  If a function is called more
  1938.         than  one  time  inside  a  function  without  any  other call in
  1939.         between,  there will be only one reference of that function  call
  1940.         in  the output tree chart.  This option results in shorter output
  1941.         files.
  1942.  
  1943.         -mtype         (CST)
  1944.         Start the data type tree chart with data  type  'type'  (-mtype).
  1945.         If  -m+  is  specified,  the  output starts with the topmost data
  1946.         type,  this is the data type which is in the highest level of the
  1947.         hierarchy  tree  chart.  The default output is in lexicographical
  1948.  
  1949.  
  1950.  
  1951.  
  1952.                                      - 32 -
  1953.  
  1954.  
  1955.         order  of  the  displayed  data  types.   Useful  if  a  selected
  1956.         structure/union  should  be  displayed  at  the  beginning of the
  1957.         output file.
  1958.  
  1959.         -m[name]       (CFT)
  1960.         -mname         (DFT, FFT, LFT)
  1961.         Start the function tree chart dump with function 'main'  (-m)  or
  1962.         'name' (-mname), name is case sensitive. If -m+ is specified, the
  1963.         output  starts  with  the topmost function,  this is the function
  1964.         which is in the highest level of the  hierarchy  tree  chart.  If
  1965.         this  option is not set,  the default is lexicographical order of
  1966.         the displayed functions.
  1967.  
  1968.         Usually,  the complete function tree chart should start with  the
  1969.         'main'  function  so  that every subfunction is a (sub-)member of
  1970.         'main'.  This option is useful for windows programs to start  the
  1971.         output with the initial 'WinMain' function (-mWinMain) instead of
  1972.         'main'.  It can also be used to start the output with the initial
  1973.         assembler start-up code being executed before the 'main'-function
  1974.         is called.
  1975.  
  1976.         -n[a]          (CFT, CST, DFT, FFT, LFT)
  1977.         Display the most critical function call path respectively display
  1978.         the data structure/union with  the  maximum  nesting  level.  The
  1979.         modificator  'a' is used to display every function/structure with
  1980.         its users/callers (DEFAULT: display only deepest call path). This
  1981.         option  helps  to  determine  the  complexity  of  the   function
  1982.         call/data  structure  hierarchy and finds recursions over several
  1983.         call/nesting levels.  Note that for functions  the  maximum  call
  1984.         path  being  displayed  is  the  result of the static source code
  1985.         analysis.  During program execution the call  path  can  be  even
  1986.         deeper if functions are called indirectly with function pointers.
  1987.  
  1988.         -ofile         (CFT, CST, DFT, FFT, LFT)
  1989.         Write  the  generated  analysis  results to file 'file'.  DEFAULT
  1990.         BEHAVIOUR: The  file  names  are  'CFT.LST'  for  CFT/CFT386  and
  1991.         'CST.LST'  for  CST/CST386.  Possible  overwriting of an existing
  1992.         output file with the same name other than the default one will be
  1993.         detected and prompted for user reconfirming. The resulting output
  1994.         file is an ASCII text file with no  formatting  characters  which
  1995.         can  be  printed  with  every printer,  viewed and/or edited with
  1996.         every text editor and taken as  input  to  word  processors,  for
  1997.         example for documentation purposes.
  1998.  
  1999.         -p             (CFT, CST, DFT, FFT, LFT)
  2000.         Calculate  the  program  code/file  size ratio for every file and
  2001.         make a final summary.  This option gives a short  overview  about
  2002.         the 'real' file contents versus complexity. The computed value is
  2003.         in  the  range from 0.000 (only comment,  no code) to 1.000 (only
  2004.         code, no comment). Used together with -P,  the results may not be
  2005.         absolutely correct because of the macro expanding and removing of
  2006.         parts  of  the  source  code  by  '#if...'  control  blocks.   If
  2007.         preprocessing -P is enabled, comment byte count in included files
  2008.         will not be performed. If option -q is set, -p will not calculate
  2009.         values related with comments.
  2010.  
  2011.  
  2012.  
  2013.                                      - 33 -
  2014.  
  2015.  
  2016.         -q             (CFT, CST)
  2017.         Remove comments from preprocessed files, default is don't remove.
  2018.         This option is only valid with option -P,  it also affects the -p
  2019.         option because counting comments is not possible and calculations
  2020.         on them cannot be done.
  2021.  
  2022.         -qn            (FFT)
  2023.         Set  the number of continuation lines to 'n' (DEFAULT: 19 lines).
  2024.         The number must be in the range from 0 to 99.
  2025.  
  2026.         -r             (CFT, CST, DFT, FFT, LFT)
  2027.         This is almost the same as option  -x,  but  an  additional  file
  2028.         reference  with  the  file  name  and  the  line  number  of  the
  2029.         declaration will be given (includes -x).
  2030.  
  2031.         The -r or the -x option is STRICTLY  RECOMMENDED  and  should  be
  2032.         used as a default option, because without it, every function/data
  2033.         type  will  be  completely redisplayed,  including the underlying
  2034.         subtree of functions or data types,  whenever it  occurs  in  the
  2035.         output  tree  chart  and  so  the resulting output file will grow
  2036.         immense,  up to several megabytes,  if there is enough disk space
  2037.         to write the output file.
  2038.  
  2039.         -s             (CFT, CST, DFT, FFT, LFT)
  2040.         Used with -C,  this option gives additional informations. For CFT
  2041.         for every function: the number of lines for  the  function  body,
  2042.         the  maximum  brace levels,  the number of bytes for the function
  2043.         body and the number of comment bytes inside  the  function  body.
  2044.         The  average  values  for  every  source  file  are  computed and
  2045.         displayed.  For CST for every data type: number of type elements,
  2046.         number of subelements (nested structures/unions).
  2047.  
  2048.         -time          (CFT, CST, DFT, FFT, LFT)
  2049.         Print  runtime  informations  about the times consumed for source
  2050.         analysis,  preprocessing,  output  dump,   database  reading  and
  2051.         writing and for other miscellaneous jobs plus the total time. The
  2052.         results are given in the format MINUTE:SECOND.MILLISECOND.
  2053.  
  2054.         -u             (CFT, DFT, FFT, LFT)
  2055.         List  undefined  functions.  These functions are probably library
  2056.         functions,  defined in other files which have not been scanned or
  2057.         are unresolved externals found by the linker.
  2058.  
  2059.         -vpath         (CFT, CST, FFT)
  2060.         Set a specific path for the intermediate precompiler output file.
  2061.         This  option  is  useful  to  speed  up  execution speed when the
  2062.         intermediate file can be stored on a RAM-disk so that file access
  2063.         to the precompiled file is much  faster  than  on  a  hard  disk.
  2064.         Environment  variables  like  'TMP' or 'TEMP' to set the path for
  2065.         temporary files are not evaluated.
  2066.  
  2067.  
  2068.  
  2069.  
  2070.  
  2071.  
  2072.  
  2073.  
  2074.                                      - 34 -
  2075.  
  2076.  
  2077.         -x             (CFT, CST, DFT, FFT, LFT)
  2078.         Cross reference in case of multiple use.  Every function and data
  2079.         type   will  be  given  a  unique  reference  number  which  will
  2080.         furthermore be used as an identifying reference  number  for  the
  2081.         function  or data type if it is again displayed.  See also option
  2082.         -r for further descriptions.
  2083.  
  2084.         -y             (CFT, CST, DFT, FFT, LFT)
  2085.         Display cross link list of files which  contain  referencing  and
  2086.         referenced  functions/data  types  of  functions/data  types of a
  2087.         specific file.  This option shows the relations in the  following
  2088.         form:
  2089.  
  2090.              1. referencing file
  2091.              ...
  2092.              n. referencing file
  2093.         file
  2094.              1. referenced file
  2095.              ...
  2096.              m. referenced file
  2097.  
  2098.         This  option  is  useful  if  you  want  to  find  out  the  file
  2099.         relationsships.  This information can be used to isolate specific
  2100.         files from a project,  e.g.  library files.  It is also useful if
  2101.         you want to separate a function and  want  to  know  which  other
  2102.         files are needed because they contain called functions.
  2103.  
  2104.         -z             (CFT, CST, DFT, FFT, LFT)
  2105.         Generate  a  function/data  type call cross reference table.  For
  2106.         every function/data type the location of  its  definition  (file,
  2107.         line)  and  a  complete  list of its calls/references,  sorted by
  2108.         files and line numbers is given in the following form:
  2109.  
  2110.         1. function/data type (reference #) [file #], line #
  2111.              [file #]: line #, ...
  2112.              ...
  2113.  
  2114.         2. ...
  2115.              ...
  2116.  
  2117.         The functions/data types are displayed in lexicographical  order.
  2118.         At the end of the section is the cross reference file list.
  2119.  
  2120.         -//            (CFT, CST)
  2121.         Accept C++ comments '//...' in C source code.  This option can be
  2122.         used to ensure compatibility with  C  compilers  which  can  also
  2123.         recognize  C++  comments within C source code (like Microsoft and
  2124.         Borland).
  2125.  
  2126.         -?             (CFT, CST, DFT, FFT, LFT)
  2127.         Shows the command line syntax and gives  a  short,  but  complete
  2128.         help information about the accepted commands and their syntax.
  2129.  
  2130.  
  2131.  
  2132.  
  2133.  
  2134.  
  2135.                                      - 35 -
  2136.  
  2137.  
  2138.         COMMAND LINE FILES
  2139.  
  2140.         cmdfile        (CFT, CST, DFT, FFT, LFT)
  2141.         Specifies  a  file  with (additional) command line options.  This
  2142.         might be useful if the command line would be too long because  of
  2143.         the  number  of  options and files declared or if you are usually
  2144.         using the same options which can then  be  stored  in  a  command
  2145.         file.  The  initial  '$'-character  is required to mark a command
  2146.         file.
  2147.  
  2148.         filelist       (CFT, CST, DFT, FFT, LFT)
  2149.         A file with a list of source file(s) to be  processed,  wildcards
  2150.         are  accepted.  The  list file should have every file on a single
  2151.         line.  The rules for files containing  assembler  code  and  path
  2152.         translation  are  described  above.  The initial '@'-character is
  2153.         required to mark a filelist file.  The '+' sign for  subdirectory
  2154.         processing is also possible inside the filelist file.
  2155.  
  2156.         [+]file        (CFT, CST, DFT, FFT, LFT)
  2157.         The name of a source file to be processed. More than one file can
  2158.         be specified on the command line.  The default assumption for the
  2159.         given files is that they contain C source code.  Assembler source
  2160.         files  are  only  recognised  by the file extension '.ASM' (80x86
  2161.         MASM/TASM) and '.S' (Intel 80960, GNU).
  2162.  
  2163.         The '+' sign indicates that,  starting from the given  directory,
  2164.         all  subdirectories  should be searched recursively for the given
  2165.         file name search pattern.  This addition is  useful  if  a  large
  2166.         software  project  is  divided into several modules with separate
  2167.         subdirectories for each module.  In that case only  the  starting
  2168.         (root-)directory with the requested file name search pattern must
  2169.         be   specified   to   search   the   current  directory  and  all
  2170.         subdirectories.
  2171.  
  2172.         If the file name or the include file specification inside a  file
  2173.         contains a relative path ('./',  '.\', '../' or '..\') it will be
  2174.         translated into  an  absolute  path  starting  from  the  current
  2175.         working directory respectively in case of include files depending
  2176.         on  the  path of the parent file.  Command line wildcards '*' and
  2177.         '?' are possible and will be accepted.
  2178.  
  2179.  
  2180.         REMARKS ON USING OPTIONS
  2181.  
  2182.         NONE OF THE ABOVE DESCRIBED OPTIONS IS PREDEFINED SO IT'S  UP  TO
  2183.         THE  USER HIMSELF TO CUSTOMIZE HIS PREFERRED PROCESSING BEHAVIOUR
  2184.         AND OUTPUT STYLE BY ADDING CONTROL OPTIONS NEEDED THEREFORE.
  2185.         This assumption seems to be the best way to give  the  users  the
  2186.         freedom  of  making  their  own decisions about the features they
  2187.         really need for doing their work.
  2188.  
  2189.         However,  some of the above described options should be  regarded
  2190.         and  used  as 'DEFAULT' options to generate a readable,  complete
  2191.         and useful output file without unexpected side  effects.  So  the
  2192.         minimum default command lines look like
  2193.  
  2194.  
  2195.  
  2196.                                      - 36 -
  2197.  
  2198.  
  2199.              CFT -m -ra <files>
  2200.              CST -ra <files>
  2201.  
  2202.         Both  command  sets  generate  a  complete listing containing all
  2203.         items with file name and line reference and a cross reference  id
  2204.         for repeated use (options -ra).  The option -m for CFT forces the
  2205.         output  to  start  with  the  'main'  function  (if  found).  The
  2206.         precompile  option  -P is not strictly necessary though for exact
  2207.         results it should also be set together with the  -T  option.  The
  2208.         standard default command line might be
  2209.  
  2210.              CFT -m -rauspMP -T<type> -cs -Cs -na -Zs -G <file[s]>
  2211.              CST -rapMP -T<type> -cs -Cs -na -Zs -G <file[s]>
  2212.  
  2213.         If you start using CFT and CST for your own business,  take these
  2214.         options as a basic set and try other options to get a feeling for
  2215.         what they are useful and how they affect the output.
  2216.  
  2217.         The large number of options may be confusing  for  beginners  but
  2218.         this  is  the  only  way  to  give  the  users the flexibility of
  2219.         customising their own output. Therefore,  take some time to learn
  2220.         about CFT and CST and their features,  read this manual carefully
  2221.         and make your own experiences with this software.
  2222.  
  2223.         It is possible to declare more than one source file, command file
  2224.         and list file on the command line.  In that  case  they  will  be
  2225.         processed  in  the  order  they appear.  Files and options can be
  2226.         placed  in  mixed  order  on  the  command  line,   there  is  no
  2227.         recommended order for them because all options (also those inside
  2228.         command  files!)  will  be  processed before any source files are
  2229.         scanned.
  2230.  
  2231.         The maximum command line length for DOS  is  127  characters,  so
  2232.         this  is  a  system dependent 'natural' limit for the options and
  2233.         file names being declared.  If you have more  items  to  declare,
  2234.         place them into command list files and file list files,  which do
  2235.         not have such limitations.
  2236.  
  2237.         Options can also be defined by the environment variables CFT  and
  2238.         CST (also used for CFT386 and CST386) like
  2239.  
  2240.              SET CFT=...
  2241.              SET CST=...
  2242.  
  2243.         To separate single options in the environment string,  spaces are
  2244.         required.  See also the description for the -D option for remarks
  2245.         on environment variable definitions.
  2246.  
  2247.         The rules for the interpretation of options is
  2248.  
  2249.         1.   if  defined,  all  options  in the environment variables CFT
  2250.              (for CFT and CFT386) or CST (for CST  and  CST386)  will  be
  2251.              taken,
  2252.         2.   the  command  line  options  and  the  option  files will be
  2253.              interpreted in the order they appear.
  2254.  
  2255.  
  2256.  
  2257.                                      - 37 -
  2258.  
  2259.  
  2260.         If an option is declared different more than once  then  previous
  2261.         declarations will be overwritten by the newer one.
  2262.  
  2263.         If  options  are  represented  by  a  single  character  with  no
  2264.         additional optional values possible like -r or -a,  they  can  be
  2265.         grouped together with a single leading '-' in front like '-rasM',
  2266.         which is the same as '-r -a -s -M'.  The last option however, can
  2267.         have  additions,   for  example  '-rasMmWinMain'  which  can   be
  2268.         evaluated  to  '-r -a -s -M -mWinMain'.  If an option can have an
  2269.         additional parameter,  the parameter must be specified without  a
  2270.         space between the option character. Leaving this space means that
  2271.         no additional parameter is given for this option.
  2272.  
  2273.         File names being composed of drive letter,  directory name,  file
  2274.         name and file extension,  in the  following  referred  simply  as
  2275.         'path  name',  are  treated by some special procedures to force a
  2276.         unique style of their internal representation:
  2277.  
  2278.         -    path names are always  considered  not  case  sensitive,  so
  2279.              there  is no difference in upper case,  lower case and mixed
  2280.              case path names (the reason is that DOS does  not  make  any
  2281.              difference),
  2282.         -    path names containing './', '.\', '../' and '..\' (so called
  2283.              'relative paths') are expanded and transformed into absolute
  2284.              paths,
  2285.         -    the recommended directory delimiter is '/' (UNIX-style),  if
  2286.              a '\' (DOS-style) is recognised in a path name,  it will  be
  2287.              replaced by '/',
  2288.         -    path  names  are  always  expanded  and transformed into the
  2289.              default style
  2290.  
  2291.                   <DRIVE LETTER>:<DIRECTORY PATH>/<FILE NAME>
  2292.  
  2293.              to get a unique representation for every file name that must
  2294.              be handled during processing,
  2295.         -    file names have a DOS like maximum length of 12  characters:
  2296.              '<8 characters name>.<3 characters extension>', this is also
  2297.              true  for  the  Windows  NT  and  OS/2  versions  of the SXT
  2298.              programs.
  2299.  
  2300.         These  actions  are  done  with  every  path  name  during   file
  2301.         processing.  File  names  given  on  the  command  line  are also
  2302.         transformed.
  2303.  
  2304.         If you want  to  perform  database  generation  (option  -G)  for
  2305.         different  projects,  you  are  responsible  to separate them and
  2306.         avoid overwriting of existing databases.  This can be done either
  2307.         by  giving  the  databases  different  names so that the database
  2308.         files can be placed all in the same directory,  or every database
  2309.         must be written into its own directory. If you want to access the
  2310.         databases  be  sure  to  use  the correct name and/or path,  also
  2311.         within the BRIEF or MicroEMACS editors.
  2312.  
  2313.  
  2314.  
  2315.  
  2316.  
  2317.  
  2318.                                      - 38 -
  2319.  
  2320.  
  2321.         COMMAND LINE EXAMPLES
  2322.  
  2323.         1.   CFT -m -rau *.c
  2324.         This program invocation of  CFT  processes  all  files  with  the
  2325.         extension  ".c"  in the current directory and generates an output
  2326.         file starting with the "main"-function (option -m) for the output
  2327.         tree.  Every function will be displayed with file and line number
  2328.         reference and a cross reference number (option -r). All functions
  2329.         will be shown in lexicographical order (-a),  also undefined ones
  2330.         (-u).
  2331.  
  2332.         2.   CFT -mWinMain -rausMP -TMSC70,L -Id: -cs -Cs -na  -ve:  -C++
  2333.              *.c ..\*.c *.cpp
  2334.         This  invocation  is similar to the one described above with some
  2335.         extensions.  The source files from the current (*.c,  *.cpp)  and
  2336.         from  the  parent  (..\*.c) directory,  they will be preprocessed
  2337.         (-P) with MS-C 7.0 defines for large  memory  model  (-TMSC70,L),
  2338.         the include file path will be taken from the environment variable
  2339.         "INCLUDE"  (default for -P) and the path "d:" (-Id:) will also be
  2340.         searched for.  The precompiler output  is  stored  in  path  "e:"
  2341.         (-ve:).  C++  extensions  and keywords will be recognised if they
  2342.         occur (-C++).  The output will start with the  "WinMain"-function
  2343.         (-mWinMain).  There  will  be a sorted call statistic (-cs) and a
  2344.         function summary for every scanned  file  (-Cs)  with  additional
  2345.         informations for every function (-s).  The critical function call
  2346.         path for all functions will be calculated and displayed (-na) and
  2347.         the included files of every source file will be shown (-M).
  2348.  
  2349.         3.   CST -S"struct _test" -r *.h -W2 -C++
  2350.         Start CST to  scan  all  files  in  the  current  directory  with
  2351.         extension  ".h" for data types.  They will be displayed with file
  2352.         name and line number reference and cross reference  number  (-r).
  2353.         The  output  should  be  done  for  the  data type 'struct _test'
  2354.         (-S"struct _test"). The warning level is set to "2" (-W2).
  2355.  
  2356.         4.   CFT y.c -R -Dmain=main_entry z.c -P x.c
  2357.         Start CFT to produce a reverse calling tree (-R) of the functions
  2358.         found in  the  files  "x.c",  "y.c"  and  "z.c"  in  the  current
  2359.         directory.  The files will be preprocessed (-P) before file scan,
  2360.         the  name  "main"  will  be  replaced  by   "main_entry"   during
  2361.         preprocessing (-Dmain=main_entry).
  2362.  
  2363.         5.   CST $cst1.cmd $cst2.cmd -ve\tmp: @cstfiles +*.h -olist.v1a
  2364.         This  invocation  of  CST  receives  its options from the command
  2365.         files "cst1.cmd"  and  "cst2.cmd"  and  stores  the  preprocessor
  2366.         output in path "e:\tmp" (-ve:\tmp). The files being processed are
  2367.         defined  in  the  source  list file "cstfiles" and on the command
  2368.         line by  "+*.h".  The  "+*.h"  file  specification  searches  the
  2369.         current  directory  and  all  subdirectories  for  files with the
  2370.         extension  ".h".   The  output  file  will  be  named  "list.v1a"
  2371.         (-olistv1a).
  2372.  
  2373.  
  2374.  
  2375.  
  2376.  
  2377.  
  2378.  
  2379.                                      - 39 -
  2380.  
  2381.  
  2382.         6.   CFT -ra -PGNUINC -TGNU -M c:\gnu\src\*.c c:\gnu\src\*.s -d10
  2383.         CFT scans all files with extension ".c" and ".s" in the directory
  2384.         "c:\gnu\src". They will be preprocessed with an include file path
  2385.         defined  in environment variable "GNUINC" (-PGNUINC) for compiler
  2386.         type "GNU" (-TGNU).  The output contains all functions (-a)  with
  2387.         complete  reference  information  (-r) and a list of all included
  2388.         files for every  source  file  (-M).  The  output  tree  will  be
  2389.         truncated if the nesting level is higher than 10 (-d10).
  2390.  
  2391.         7.   CST *.c
  2392.         CST  processes  all  files  with  extension  ".c"  in the current
  2393.         working directory.  There are no options specified,  so only  the
  2394.         options set by the environment variable 'CST',  if present,  will
  2395.         be used to customise the program execution.  As  an  example  the
  2396.         command  line  options  used  in  example  6.  can  be defined as
  2397.         environment variable CST by 'SET CST=-raMKPGNUINC -TGNU -d10'.
  2398.  
  2399.         8.   CFT -ra -PI960INC -TI960,KB *.c *.s
  2400.         CFT scans all files with extension ".c" and ".s" in  the  current
  2401.         directory.  They  will  be preprocessed with an include file path
  2402.         defined  in  environment  variable  "I960INC"   (-PI960INC)   for
  2403.         compiler type "I960",  'KB' architecture (-TI960,KB).  The output
  2404.         contains all functions (-a) with complete  reference  information
  2405.         (-r).
  2406.  
  2407.         9.   CFT -rRM -gproj40 -Gproj41
  2408.         CFT reads the database named 'proj40' (-g) and produces as output
  2409.         the  reverse  function  call  tree  (-R)  with complete reference
  2410.         information (-r), the (include) file interdependencies (-M) and a
  2411.         new database named 'proj41'.
  2412.  
  2413.         10.  CST -g -Gnew -N
  2414.         CST reads the  default  database  (-g)  and  produces  as  output
  2415.         another  database  named  'new' (-Gnew).  No other output file is
  2416.         generated (-N).
  2417.  
  2418.         11.  CST -N -OTEST -O+ test.h
  2419.         CST reads the file "test.h", generates no output file (-N), but a
  2420.         byte offset calculation file for data type  'TEST'  (-OTEST)  and
  2421.         its enclosed type members (-O+).
  2422.  
  2423.  
  2424.  
  2425.  
  2426.  
  2427.  
  2428.  
  2429.  
  2430.  
  2431.  
  2432.  
  2433.  
  2434.  
  2435.  
  2436.  
  2437.  
  2438.  
  2439.  
  2440.                                      - 40 -
  2441.  
  2442.  
  2443.         9    OUTPUT DESCRIPTION AND INTERPRETATION
  2444.  
  2445.         This section gives an overview about the files being generated by
  2446.         CFT  and  CST  and  the interpretation of the results.  Different
  2447.         files are produced as output depending on the options  being  set
  2448.         by  the  user.  Usually,  if -N is not set,  all informations are
  2449.         written to the default output file CFT.LST or CST.LST or  to  the
  2450.         file specified by the -o option.  The internal structure of these
  2451.         files  and  their  meanings  are  described  below.  If  database
  2452.         generation is enabled with option -G, several files are produced.
  2453.         They  all  have a common database name to identify the files that
  2454.         are related with a project.  The file extension '.DBF' marks  the
  2455.         dBASE  compatible  database  files,  the  file with the extension
  2456.         '.CMD' contains the command line options and the  file  with  the
  2457.         extension  '.SRC'  contains all source files that were processed.
  2458.         For further informations refer to the  corresponding  section  in
  2459.         the syntax description.
  2460.  
  2461.  
  2462.         CFT OUTPUT
  2463.  
  2464.         The  output  file  is divided into several sections.  Some of the
  2465.         sections listed are generated by default (-), others are optional
  2466.         (o) and only displayed if they are  enabled  by  a  command  line
  2467.         option.  Also,  the default sections can be customised to produce
  2468.         the desired output.  The sections generated for CFT are  (in  the
  2469.         order they appear):
  2470.  
  2471.         -    file header
  2472.         -    function calltree/called-by hierarchy listing (-r,  -R,  -x,
  2473.              -a, -m, -f, -dn, -V, -l)
  2474.         -    function summary
  2475.         -    multiple defined  functions  and  their  location  (only  if
  2476.              detected)
  2477.         -    overloaded functions and their location (only if detected)
  2478.         o    undefined functions (-u)
  2479.         o    function call statistics (-c[s])
  2480.         o    function caller/member relations (-Z[s])
  2481.         o    function call cross reference table (-z)
  2482.         o    critical function call path (-n[a])
  2483.         o    source file - include file dependency (-M)
  2484.         o    function tables for source files (-C[s], -s, -q)
  2485.         -    file information summary (-p, -q)
  2486.  
  2487.         Each function is displayed like:
  2488.  
  2489.              int test()  (1) <DMPCA> <TEST.C, 100>
  2490.  
  2491.         with the following meanings
  2492.  
  2493.              - int          : function return type
  2494.              - test()       : function name
  2495.              - (1)          : function reference number
  2496.  
  2497.  
  2498.  
  2499.  
  2500.  
  2501.                                      - 41 -
  2502.  
  2503.  
  2504.              - <DMPCA>      : found as (one or more of)
  2505.                                  D = definition,
  2506.                                  M = macro,
  2507.                                  P = prototype,
  2508.                                  C = function call,
  2509.                                  A = assembler function
  2510.              - <TEST.C, 100>: file name, line number
  2511.  
  2512.         The  line  number is the line where the function definition block
  2513.         starts with its initial '{' and not the line where  the  function
  2514.         name  resides.  I think that this is the best solution because it
  2515.         is the point where we go really inside the function  block.  This
  2516.         convention  is also used by source level debuggers which point on
  2517.         the line with the opening brace on function entry.
  2518.  
  2519.  
  2520.         CST OUTPUT
  2521.  
  2522.         The output file is divided into several  sections.  Some  of  the
  2523.         sections listed are generated by default (-), others are optional
  2524.         (o)  and  only  displayed  if  they are enabled by a command line
  2525.         option.  Also,  the default sections can be customised to produce
  2526.         the  desired  output.  The sections generated for CST are (in the
  2527.         order they appear):
  2528.  
  2529.         -    file header
  2530.         -    data structure calltree/called-by hierarchy listing (-r, -R,
  2531.              -x, -a, -m, -f, -dn)
  2532.         -    data type summary
  2533.         -    multiple defined data types  and  their  location  (only  if
  2534.              detected)
  2535.         o    data type call statistics (-c[s])
  2536.         o    data type caller/member relations (-Z[s])
  2537.         o    data type call cross reference table (-z)
  2538.         o    maximum data type nesting (-n[a])
  2539.         o    source file - include file dependency (-M)
  2540.         o    data type tables for source files (-C[s], -s, -q)
  2541.         -    file information summary (-p, -q)
  2542.  
  2543.         Each data type is displayed like:
  2544.  
  2545.              struct _test  (1) <BSUCE> <TEST.C, 90> <TEST.C, 60>
  2546.  
  2547.         with the following meanings
  2548.  
  2549.              - struct _test : type specifier
  2550.              - (1)          : reference number
  2551.              - <BSUCE>      : data type (one/none of):
  2552.                                  B = basic type (void, char, int, ...),
  2553.                                  S = struct,
  2554.                                  U = union,
  2555.                                  C = class,
  2556.                                  E = enum
  2557.  
  2558.  
  2559.  
  2560.  
  2561.  
  2562.                                      - 42 -
  2563.  
  2564.  
  2565.              - <TEST.C, 90> : file name, line number of type definition
  2566.                               (only printed if necessary)
  2567.              - <TEST.C, 60> : file name, line number of basic type
  2568.                               definition
  2569.  
  2570.         The two locations for the data type can occur if the data type is
  2571.         first  defined  and  later assigned via 'typedef' or by '#define'
  2572.         (if -P is not set) to another data type name:
  2573.  
  2574.         test.c:   ...
  2575.         line 60:  struct xyz {...};
  2576.                   ...
  2577.         line 90:  typedef struct xyz struct _test;
  2578.                   ...
  2579.  
  2580.         Their definition is on different lines but both data  type  names
  2581.         refer to the same data structure.
  2582.  
  2583.         Like  the  convention used for functions,  the line number is the
  2584.         line where  the  structure,  union,  enumeration  or  class  type
  2585.         definition  block  starts  with  its initial '{' and not the line
  2586.         where the type name resides.
  2587.  
  2588.         For an example session and more detailed informations  about  the
  2589.         generated output of CFT and CST see the file EXAMPLE.DOC.
  2590.  
  2591.  
  2592.         OUTPUT INTERPRETATION
  2593.  
  2594.         Besides the hierarchical structure chart of the function and data
  2595.         type relationships,  the resulting output contains several useful
  2596.         informations  about  the  program   which   can   be   used   for
  2597.         optimization, reuse or maintenance purposes. Identifying the most
  2598.         frequently  called functions is a good way to find candidates for
  2599.         further optimization.  Low-level functions with many callers  but
  2600.         no  called  subfunctions  are ideal for reuse.  Functions with no
  2601.         callers may be useless if the function is  also  not  called  via
  2602.         function  pointers and can be discarded therefore.  The chance to
  2603.         find errors in complex functions with many lines of source  code,
  2604.         many  called  functions  and  a lot of control statements is much
  2605.         bigger than in simple functions.
  2606.  
  2607.  
  2608.  
  2609.  
  2610.  
  2611.  
  2612.  
  2613.  
  2614.  
  2615.  
  2616.  
  2617.  
  2618.  
  2619.  
  2620.  
  2621.  
  2622.  
  2623.                                      - 43 -
  2624.  
  2625.  
  2626.         10   INTEGRATION INTO PROGRAM DEVELOPMENT ENVIRONMENTS
  2627.  
  2628.         Invoking CFT and CST directly from inside editors  or  integrated
  2629.         programming  environments (IDE) and displaying the results can be
  2630.         a very useful feature during program development.  With  advanced
  2631.         IDE's  like  that of Borland C++ or Microsoft PWB this is an easy
  2632.         task.
  2633.  
  2634.         The Borland IDE has in its system menu a section  with  'transfer
  2635.         items.  It  contains programs that can be invoked from inside the
  2636.         IDE like TASM or GREP. To add CFT and CST as new entries you have
  2637.         to go to the OPTIONS menu and open 'TRANSFERS...'.  Choose a free
  2638.         entry  in  the  table and select EDIT.  A window will open with 3
  2639.         edit lines.  In first line called 'Program Title' you must  write
  2640.         'C~FT'  resp.  'C~ST' as the name being displayed in the transfer
  2641.         section. The '~' prepends the hot-keys 'F' and 'S'. In the second
  2642.         line  called  'Program  Path'  you  must  write  'CFTIDE'   resp.
  2643.         'CSTIDE',  maybe with the complete path,  if necessary.  'CFTIDE'
  2644.         and 'CSTIDE' are two batch files which perform the invocation  of
  2645.         CFT  resp.  CST together with the necessary options.  These batch
  2646.         files are part of the CXT package,  you can  change  the  options
  2647.         defined  there  if you need other ones.  In the third line called
  2648.         'Command Line' you must write the macro commands '$EDNAME $NOSWAP
  2649.         $CAP EDIT'.  These macros transfer the file name in  the  current
  2650.         edit window ($EDNAME) to the batch file, suppress window swapping
  2651.         ($NOSWAP)  and  capture  the  processing  results  in an own edit
  2652.         window ($CAP EDIT). The last step is to save these entries,  then
  2653.         the  integration  is  completed and CFT and CST can be used as if
  2654.         they were built-in functions. The processing results are shown in
  2655.         an edit window which can be scrolled, resized or moved. By adding
  2656.         CFT and CST to the IDE it is much easier for  the  programmer  to
  2657.         use these tools.
  2658.  
  2659.  
  2660.  
  2661.  
  2662.  
  2663.  
  2664.  
  2665.  
  2666.  
  2667.  
  2668.  
  2669.  
  2670.  
  2671.  
  2672.  
  2673.  
  2674.  
  2675.  
  2676.  
  2677.  
  2678.  
  2679.  
  2680.  
  2681.  
  2682.  
  2683.  
  2684.                                      - 44 -
  2685.  
  2686.  
  2687.         11   TOOLS FOR DATABASE PROCESSING
  2688.  
  2689.         To  access  informations  stored  in  a  database,  the following
  2690.         utilities are available for the SXT programs:
  2691.  
  2692.              CFTN      C Function Tree Navigator
  2693.              CSTN      C Structure Tree Navigator
  2694.              DFTN      DBASE Function Tree Navigator
  2695.              FFTN      FORTRAN Function Tree Navigator
  2696.              LFTN      LISP Function Tree Navigator
  2697.  
  2698.         They can be used to recall the file name and  line  number  of  a
  2699.         specific  item (function or data type) from the database.  If the
  2700.         requested item is found in the database,  it  will  be  displayed
  2701.         with  its  location  where it is defined or where it is found for
  2702.         the  first  time  if  there  was  no  definition   found   during
  2703.         processing.
  2704.  
  2705.         As an additional feature editors like BRIEF 3.0, QEDIT 2.1/3.0 or
  2706.         MicroEMACS  3.11 can be invoked directly with the informations to
  2707.         open the target file and to move the cursor to the line where the
  2708.         searched item is located.  For BRIEF  there  are  several  macros
  2709.         available  to  perform  searching  inside the editor.  A new edit
  2710.         window with the file at the location of the requested  item  will
  2711.         be  opened  if  the  search was successful.  Also both MicroEMACS
  2712.         editor versions for DOS and WINDOWS are supported.  Some of these
  2713.         actions are also possible for QEDIT,  with slight limitations due
  2714.         to the macro programming capabilities.
  2715.  
  2716.         Other user programmable editors which should be able to work with
  2717.         CFTN and CSTN are EPSILON,  ME,  KEDIT,  Codewright,  Multi-Edit,
  2718.         JED,  GNU-EMACS ports like DEMACS or OEMACS, the Microsoft editor
  2719.         M or integrated development  environments  like  Borland  IDE  or
  2720.         Microsoft  PWB  (this  list may not be complete).  You can try to
  2721.         integrate CFTN and CSTN into these systems by  using  the  BRIEF,
  2722.         QEDIT  or  MicroEMACS  macro  files  as  examples  for  your  own
  2723.         integration development.
  2724.  
  2725.         The version numbers for the  editors  mentioned  in  this  manual
  2726.         indicate those versions for which the described capabilities have
  2727.         been tested.
  2728.  
  2729.  
  2730.         PRECOMPILED SOURCE FILES
  2731.  
  2732.         Sometimes,  if  the  precompile option -P was used to process the
  2733.         C/C++ source files related with  the  database,  the  results  of
  2734.         searches  seem  to be wrong.  This can happen if an identifier in
  2735.         the source code is in fact  defined  as  a  macro  and  has  been
  2736.         exchanged  during  preprocessing  so  that  the  resulting source
  2737.         processed by the analyser is different from the  original  source
  2738.         and  the cursor will point to an obviously  wrong location or the
  2739.         search will fail.  An identifier which is in fact a macro name is
  2740.         unknown  and  not  accessible  after  precompiling.  It  is  also
  2741.         possible that a function being used in the original source  could
  2742.         not be found in the database.  The reason is that the function is
  2743.  
  2744.  
  2745.                                      - 45 -
  2746.  
  2747.  
  2748.         in  fact  a  'function  like'  macro  and  was  replaced   during
  2749.         preprocessing.  If  different  named macros are defined equal,  a
  2750.         search for an  item  may  point  to  another  location  than  the
  2751.         requested.  If  the -P option is not set,  the same item can have
  2752.         several 'alias'- names due to macro defining.  If the source code
  2753.         contains  explicit  #line numbers,  searching for a specific line
  2754.         may also fail.  Keep these  exceptions  in  mind  for  a  correct
  2755.         interpretation the results when using the database.
  2756.  
  2757.         IMPORTANT NOTICE
  2758.  
  2759.         Recalling  informations  from  the  database  may not be valid if
  2760.         files being processed were edited and changed after the  database
  2761.         generation has been performed. Errors can result like pointing to
  2762.         wrong  files  and/or  lines  if source lines have been deleted or
  2763.         inserted,  failed  searches  if  names  have  changed  or  failed
  2764.         accesses to files which may have been renamed,  moved or deleted.
  2765.         To avoid these errors,  a consistency check for the file creation
  2766.         date/time and file size will be performed by the recall programs.
  2767.         If inconsistencies are recognised, the user will be informed that
  2768.         the   database  is  not  up-to-date  and  should  be  updated  by
  2769.         processing the source files again.
  2770.  
  2771.  
  2772.         SYNTAX:   CFTN [options] pattern
  2773.                   CSTN [options] pattern
  2774.                   DFTN [options] pattern
  2775.                   FFTN [options] pattern
  2776.                   LFTN [options] pattern
  2777.  
  2778.         OPTIONS
  2779.  
  2780.         -Eeditor
  2781.         Specifies the editor command line for option -e,  overwrites  the
  2782.         default  and  the  environment  values.  See  the  section  about
  2783.         environment variables for further informations about the required
  2784.         format.
  2785.  
  2786.         -F
  2787.         Print all file names which are related with  the  database.  This
  2788.         option  is  useful  to get a complete overview about all files of
  2789.         the project.
  2790.  
  2791.         -a
  2792.         Print all function/data type names.  Useful to generate a list of
  2793.         items, for example as input to other programs.
  2794.  
  2795.         -B
  2796.         Same as -a,  but prints additionally the internal database record
  2797.         number. Used by BRIEF macros.
  2798.  
  2799.         -bform
  2800.         Run search in batch-mode, this means that,  if the requested item
  2801.         was  found,  the  location  will be displayed on a single line as
  2802.         "file name line number" (DEFAULT STYLE),  otherwise there will be
  2803.         no output that the search failed. The output style can be changed
  2804.  
  2805.  
  2806.                                      - 46 -
  2807.  
  2808.  
  2809.         by  specifying  'form'  to overwrite the default style.  Like for
  2810.         option -E you can specify the exact locations where the file name
  2811.         and line number should be inserted by defining  a  format  string
  2812.         with   %s   and  %d  (See  also  the  section  about  environment
  2813.         variables).  For example,  the format to generate a command  line
  2814.         for invoking BRIEF, QEDIT or MicroEMACS would look like
  2815.  
  2816.              cstn -b"b -m\"goto_line %d\" %s" ...         (BRIEF)
  2817.              cstn -b"q %s -n%d" ...                       (QEDIT)
  2818.              cstn -b"me -G%d %s"                          (MicroEMACS)
  2819.  
  2820.         This option gives you a great flexibility in generating an output
  2821.         for  your own purposes,  for example to write a batch file or for
  2822.         further use in other programs.
  2823.  
  2824.         -e
  2825.         If the requested item is found,  an editor  will  be  invoked  to
  2826.         display  the file containing the requested item.  There are three
  2827.         different ways to specify the editor command line  (evaluated  in
  2828.         that order):
  2829.  
  2830.         1)   use option -E,
  2831.         2)   define  the  environment  variables  CFTNEDIT,  CSTNEDIT  or
  2832.              CXTNEDIT,
  2833.         3)   if nothing is specified,  BRIEF as the  default  editor  (if
  2834.              present)  will be invoked with the file name and line number
  2835.              of the item to move the cursor to its location.  Ensure that
  2836.              the  PATH  environment variable is set correctly,  including
  2837.              the path for the BRIEF directory.
  2838.  
  2839.         -fname
  2840.         Use 'name' as base name (path and file name) for database  files.
  2841.         It  is  also  possible  to  use  environment variables (CFTNBASE,
  2842.         CSTNBASE, CXTNBASE) for the definition of the database names.  If
  2843.         -f and environment variables are not set,  a DEFAULT NAME will be
  2844.         used (see also option -G from CFT and  CST  syntax  description).
  2845.         This  allows  the  use  of  different  databases,   for  example,
  2846.         generated for different projects.  See  also  the  section  about
  2847.         environment variables for further information.
  2848.  
  2849.         -r#
  2850.         This option prints the location for a selected item with matching
  2851.         pattern  and  record number #.  This option requires -b.  Used by
  2852.         BRIEF macros.
  2853.  
  2854.         -Ritem
  2855.         Print a cross reference list of every occurrence of  'item'  with
  2856.         complete file name and line number.
  2857.  
  2858.         -Dfile
  2859.         Print a list with the contents of 'file'.
  2860.  
  2861.  
  2862.  
  2863.  
  2864.  
  2865.  
  2866.  
  2867.                                      - 47 -
  2868.  
  2869.  
  2870.         -o[name]
  2871.         Print output to file 'name'.  If 'name' is not specified, DEFAULT
  2872.         NAMES are used: CFTN.OUT resp. CSTN.OUT.
  2873.  
  2874.         pattern
  2875.         The item to search for in the database.  This  can  either  be  a
  2876.         function name (CFTN) or a data type name (CSTN).  There are three
  2877.         different ways of searching depending how 'pattern' is given:
  2878.  
  2879.         pattern        exact search,
  2880.         pattern*       the beginning of the item must match with pattern
  2881.         *pattern       a substring must match with pattern
  2882.  
  2883.         If the item  to  search  for  consists  of  more  than  one  word
  2884.         (contains  spaces),  the  search  pattern  must  be 'quoted' like
  2885.         "struct _iobuf" to ensure that these  words  are  interpreted  as
  2886.         single pattern.
  2887.  
  2888.  
  2889.         RETURN VALUES
  2890.  
  2891.         The  following  values are returned to DOS or the calling program
  2892.         to report the result of the database search:
  2893.  
  2894.         -    100  searched item not found,
  2895.         -    101  searched item found,
  2896.         -    102  searched item found,  but the source file may have been
  2897.                   changed  (creation date and/or file size are not equal)
  2898.                   since the creation of the  database  (database  is  not
  2899.                   up-to-date).
  2900.  
  2901.         The  returned  value  can be used to decide what action should be
  2902.         done for different results,  for example,  if the database is not
  2903.         up-to-date.
  2904.  
  2905.  
  2906.         ENVIRONMENT VARIABLES
  2907.  
  2908.         CFTNEDIT, CSTNEDIT, CXTNEDIT:
  2909.         The  editor  to  invoke  can be defined either by option -e or by
  2910.         defining the environment variables CFTNEDIT (for CFTN),  CSTNEDIT
  2911.         (for  CSTN) or the commonly used variable CXTNEDIT (for both CFTN
  2912.         and CSTN) with the format string of the editor  of  your  choice.
  2913.         The format string can be used to specify the place where the file
  2914.         name  and  the  line number should be inserted to give additional
  2915.         informations to the editor.  Use %s for the file name and %d  for
  2916.         the  line  number.  For  example,  the  invocation of the default
  2917.         editor BRIEF could be defined like
  2918.  
  2919.              SET CFTNEDIT=b -m"goto_line %d" %s
  2920.              SET CSTNEDIT=b -m"goto_line %d" %s
  2921.              SET CXTNEDIT=b -m"goto_line %d" %s
  2922.  
  2923.         where 'b' is the BRIEF editor,  '-m' specifies  the  macro  being
  2924.         invoked  when BRIEF starts,  the macro name 'goto_line' with '%d'
  2925.         as the place to insert the line number and '%s' as the place  for
  2926.  
  2927.  
  2928.                                      - 48 -
  2929.  
  2930.  
  2931.         the  file  name.  Note  that  this  example cannot be used on the
  2932.         command line with -E option because of the quotes. It is possible
  2933.         to change the order of %d and %s if another editor is used.
  2934.  
  2935.         Here are additional  configuration  examples  for  other  popular
  2936.         editors (examples are given for CFTN, similar for CSTN):
  2937.  
  2938.         EDIT (MS-DOS 5.0):  SET CFTNEDIT=edit %s  or  -E"edit %s"   or
  2939.                             SET CFTNEDIT=edit     or  -Eedit
  2940.  
  2941.         VDE 1.62:           SET CFTNEDIT=vde %s   or  -E"vde %s"    or
  2942.                             SET CFTNEDIT=vde      or  -Evde
  2943.  
  2944.         QEDIT 2.1/3.0:      SET CFTNEDIT=q %s -n%d   or   -E"q %s -n%d"
  2945.  
  2946.         MicroEMACS 3.11:    SET CFTNEDIT=me -G%d %s  or   -E"me -G%d %s"
  2947.  
  2948.         The described notation allows the user to customise CFTN and CSTN
  2949.         with  his  preferred  editor  and  to  perform additional actions
  2950.         during invocation. If your editor supports macro programming like
  2951.         BRIEF you are free to write your own macros to do similar  things
  2952.         like  the CXT.CM macro given for BRIEF 3.0 does.  I think this is
  2953.         the most flexible way to give users control about this option and
  2954.         to help them working with their preferred programming environment
  2955.         and development tools.
  2956.  
  2957.         CFTNBASE, CSTNBASE, CXTNBASE:
  2958.         These environment variables can be used to specify  the  name  of
  2959.         the  database.  Similar  to  the  editor  environment  variables,
  2960.         CFTNBASE and CSTNBASE are related to CFTN and CSTN  and  CXTNBASE
  2961.         is  used for both.  For example,  to specify the database 'proj1'
  2962.         located in directory 'd:\develop\projects' type
  2963.  
  2964.              SET CFTNBASE=d:\develop\projects\proj1
  2965.              SET CSTNBASE=d:\develop\projects\proj1
  2966.  
  2967.         for a separate definition or
  2968.  
  2969.              SET CXTNBASE=d:\develop\projects\proj1
  2970.  
  2971.         for a common definition of the database name.
  2972.  
  2973.  
  2974.         COMMAND LINE EXAMPLES
  2975.  
  2976.         1)   CFTN *
  2977.         Displays all functions in lexicographical order with their return
  2978.         types, file names and line numbers.  Gives a short overview about
  2979.         all functions being found.
  2980.  
  2981.         2)   CSTN -e *
  2982.         Edit  all data types in lexicographical order,  use default or by
  2983.         environment variable CSTNEDIT or CXTNEDIT defined editor.
  2984.  
  2985.  
  2986.  
  2987.  
  2988.  
  2989.                                      - 49 -
  2990.  
  2991.  
  2992.         3)   CFTN -fproject1 -Evde -e main
  2993.         Search database named 'project1' for  function  'main'  and  edit
  2994.         with editor 'vde'.
  2995.  
  2996.         4)   CSTN -b "union REGS"
  2997.         Search for data type 'union REGS' and display, if found, the file
  2998.         name and line number
  2999.  
  3000.         5)   CSTN -e -E"q %s -n%d" -fcft tmbuf
  3001.         Search database 'cft' for data type 'tmbuf' and invoke, if found,
  3002.         the editor 'q' (QEDIT 2.1/3.0) with the file name and line number
  3003.  
  3004.  
  3005.         SEARCHING INSIDE BRIEF (Version 3.0)
  3006.  
  3007.         This  feature  is  one  of the most powerful enhancements for the
  3008.         BRIEF editor and offers the user full control over  the  complete
  3009.         source  code  of software projects no matter how big they are and
  3010.         how many files they include.  It extends the BRIEF  editor  to  a
  3011.         comfortable hypertext source code browser and locator system. The
  3012.         browser  allows  its  user  to  find  and  read various important
  3013.         program constructs like functions and data types in several files
  3014.         simultaneously and moving between them. The complete project with
  3015.         several source  and  include  files  appears  as  if  it  were  a
  3016.         'whole-part'. The browser helps the programmer to learn about the
  3017.         existing  program  structures  and supports him in developing new
  3018.         and  maintaining  existing  code.  The  programmer  can  use  the
  3019.         generated  output files CFT.LST or CST.LST (or the one he created
  3020.         with the -o option) to walk along the hierarchy tree chart and to
  3021.         select from there the  function  or  data  type  that  should  be
  3022.         displayed in detail.
  3023.  
  3024.         The following features are implemented as macros:
  3025.  
  3026.         -    searching for a specific item, tagged or marked
  3027.         -    building menus of all defined items
  3028.         -    building menus of all references to a specific item
  3029.         -    building menus of all processed files
  3030.         -    building menus of all items defined in the current file
  3031.         -    searching for a specific item cross reference number
  3032.         -    changing the database name
  3033.  
  3034.         Every  function  and  data  type  can  be  accessed  with  just a
  3035.         keystroke by moving the cursor on it ("tagging") and executing  a
  3036.         macro  to  locate  the  item  and  zoom into the file where it is
  3037.         defined.  The user does no longer have to remember the file names
  3038.         and  locations where the functions and data types are defined nor
  3039.         does he have to change  the  files,  directories  and  drives  to
  3040.         access the files manually.
  3041.  
  3042.         It  is  possible  to  build  interactive  dialog  menus  with all
  3043.         functions or data types in lexicographical order and to select an
  3044.         item to display.  This is very useful to  get  a  quick  overview
  3045.         about  all  accessible  functions  and  data  types  of the whole
  3046.         project.  It is also possible to build an interactive dialog menu
  3047.         with  all file names in lexicographical order which are stored in
  3048.  
  3049.  
  3050.                                      - 50 -
  3051.  
  3052.  
  3053.         the database and to select one file to open for edit. Other menus
  3054.         are available for file contents lists and item cross  references.
  3055.         All  informations  to  perform  these  actions  are stored in the
  3056.         databases generated by processing  the  files  related  with  the
  3057.         project.
  3058.  
  3059.         To invoke CFTN and CSTN inside BRIEF,  the macro file CXT.CM must
  3060.         be loaded (with <F9> CXT.CM),  which makes the implemented macros
  3061.         available. These macros are
  3062.  
  3063.              MACRO NAME          KEY ASSIGNMENT (defined in CXTKEYS.CM)
  3064.  
  3065.              cft                 Shift F1
  3066.              cftmenu             Shift F2
  3067.              cftxrefmenu         Shift F3
  3068.              cftxrefmenuagain    Shift F4
  3069.              cftdefmenu          Shift F7
  3070.              cftfilemenu         Shift F8
  3071.              cftfind             Shift F11
  3072.              cftbase             Shift F12
  3073.  
  3074.              cst                 Ctrl F1
  3075.              cstmenu             Ctrl F2
  3076.              cstxrefmenu         Ctrl F3
  3077.              cstxrefmenuagain    Ctrl F4
  3078.              cstdefmenu          Ctrl F7
  3079.              cstfilemenu         Ctrl F8
  3080.              cstfind             Ctrl F11
  3081.              cstbase             Ctrl F12
  3082.  
  3083.              cxtbase             Alt Tab
  3084.              cxtsearchxref       Ctrl Tab
  3085.              cxthelp             <unassigned>
  3086.  
  3087.         This  macro key assignment list is also available within BRIEF as
  3088.         a help screen which can be invoked by the  macro  'cxthelp'.  The
  3089.         CXT help information is not part of the BRIEF help system because
  3090.         this would need modifications of the original BRIEF help files.
  3091.  
  3092.         Instead  of  loading  the  file CXT.CM and typing the macro names
  3093.         manually,  you can load the macro file CXTKEYS.CM which  performs
  3094.         automatic  loading  of the CXT.CM file if any of the above listed
  3095.         macros is invoked with a hot-key.  To simplify working with  this
  3096.         package,  the CXTKEYS.CM macro file also contains key assignments
  3097.         for  the  macros.  These  hot-keys  offer  a  "point  and  shoot"
  3098.         hypertext like feeling. The macro source file CXTKEYS.CB contains
  3099.         the  source  code  for  CXTKEYS.CM  so  that you are able to make
  3100.         changes like the key assignments for your personal  needs  or  to
  3101.         move the initialization function to the BRIEF start-up macro file
  3102.         (For  further  informations  about  BRIEF  macros  see  the BRIEF
  3103.         manuals).  To load these macros and to  execute  CFTN  and  CSTN,
  3104.         which are invoked from inside BRIEF, be sure to set the directory
  3105.         path correctly. It is also necessary to allow access to the macro
  3106.         file  DIALOG.CM  which  contains  the  functions  for dialog menu
  3107.         building and processing.
  3108.  
  3109.  
  3110.  
  3111.                                      - 51 -
  3112.  
  3113.  
  3114.         A search can be started by simply moving the cursor on  the  item
  3115.         to  search  for or by marking a block with the item (necessary if
  3116.         search pattern contains more than one word like 'struct xyz') and
  3117.         then running one of the following macros (or press hot-keys):
  3118.  
  3119.              <F10> cft                     (function search)
  3120.              <F10> cst                     (data type search)
  3121.  
  3122.         It is also possible to type the name of the item  to  search  for
  3123.         manually. To do this you must run one of the following macros:
  3124.  
  3125.              <F10> cftfind <item>          (function search)
  3126.              <F10> cstfind <item>          (data type search)
  3127.  
  3128.         If  the  search  was  successful,  a  new  window  with  the file
  3129.         containing the item will be opened and the cursor will be  placed
  3130.         at  the  line where the item is located.  If inconsistencies have
  3131.         been detected,  the user will be informed.  If the requested item
  3132.         or  the  source file containing the item is not found,  a message
  3133.         will be given. The macros for building the function and data type
  3134.         dialog menu are
  3135.  
  3136.              <F10> cftmenu                 (function menu)
  3137.              <F10> cstmenu                 (data type menu)
  3138.  
  3139.         You can scroll through the  entries  and  select  an  item  which
  3140.         should  be displayed.  To access databases other than the default
  3141.         ones, there are two ways to change the base names:
  3142.  
  3143.         1)   Set the environment variables CFTNBASE, CSTNBASE or CXTNBASE
  3144.              (see description above).  By loading the macro  file  CXT.CM
  3145.              these variables will be used for initialization.
  3146.  
  3147.         2)   To change the base names from inside BRIEF,  there are three
  3148.              macros to do this.  They overwrite the initial values  given
  3149.              by the environment variables:
  3150.  
  3151.              <F10> cftbase     change base name for function search
  3152.              <F10> cstbase     change base name for data type search
  3153.              <F10> cxtbase     change both CFT and CST base name
  3154.  
  3155.         With  these features it is possible to set default values for the
  3156.         database files or to change between different  databases  without
  3157.         leaving BRIEF which gives the user a maximum of flexibility.  You
  3158.         can display a menu list with all source files being  scanned  for
  3159.         the database by typing
  3160.  
  3161.              <F10> cftfilemenu             (CFT file menu)
  3162.              <F10> cstfilemenu             (CST file menu)
  3163.  
  3164.         With  this  feature  you can get a quick overview about all files
  3165.         related with the database.  Other menu driven options concern the
  3166.         displaying  of all cross references to a specific item (see macro
  3167.         'cst' for informations about marking) with the macros
  3168.  
  3169.  
  3170.  
  3171.  
  3172.                                      - 52 -
  3173.  
  3174.  
  3175.              <F10> cftxrefmenu             (CFT cross reference menu)
  3176.              <F10> cftxrefmenuagain        (show previous menu again)
  3177.              <F10> cstxrefmenu             (CST cross reference menu)
  3178.              <F10> cstxrefmenuagain        (show previous menu again)
  3179.  
  3180.         and the displaying of a file contents list for the actual  source
  3181.         file with the macros
  3182.  
  3183.              <F10> cftdefmenu              (CFT file menu)
  3184.              <F10> cstdefmenu              (CST file menu)
  3185.  
  3186.         To  search for the first appearance of a specific cross reference
  3187.         number like '(123)' in a CFT or CST output listing file, move the
  3188.         cursor to the reference number and type
  3189.  
  3190.              <F10> cxtsearchxref           (search cross reference)
  3191.  
  3192.         The macro extracts the complete number and searches for its first
  3193.         occurrence by starting from the beginning  of  the  output  file.
  3194.         With  this  macro  you can move quickly from any reference to its
  3195.         initial description.
  3196.  
  3197.         All the above described macro functions are defined in the  BRIEF
  3198.         macro file CXT.CB. These macros make extensive use of the several
  3199.         options  of  CFTN  resp.  CSTN,  which  are  described earlier in
  3200.         detail.
  3201.  
  3202.  
  3203.         SEARCHING INSIDE QEDIT (2.1 and 3.0)
  3204.  
  3205.         The popular shareware editor QEDIT  with  its  macro  programming
  3206.         capabilities  allows,  like  the  BRIEF editor,  the searching of
  3207.         functions and data types from inside the  editor.  The  following
  3208.         examples for QEDIT macros act,  with slight limitations, like the
  3209.         BRIEF macros 'cft' and 'cst':
  3210.  
  3211.         CFT function searching, assigned to <SHIFT F9>:
  3212.  
  3213.         #f9  MacroBegin MarkWord Copy Dos 'cftn -b ' Paste '>tmp'  Return
  3214.              Return   EditFile  'tmp'  Return  AltWordSet  MarkWord  Copy
  3215.              DefaultWordSet EditFile Paste Return EditFile  'tmp'  Return
  3216.              EndLine  CursorLeft  MarkWord  Copy  Quit  NextFile GotoLine
  3217.              Paste Return
  3218.  
  3219.         CST data type searching, assigned to <SHIFT F10>:
  3220.  
  3221.         #f10 MacroBegin MarkWord Copy Dos 'cstn -b ' Paste '>tmp'  Return
  3222.              Return   EditFile  'tmp'  Return  AltWordSet  MarkWord  Copy
  3223.              DefaultWordSet EditFile Paste Return EditFile  'tmp'  Return
  3224.              EndLine  CursorLeft  MarkWord  Copy  Quit  NextFile GotoLine
  3225.              Paste Return
  3226.  
  3227.         These  QEDIT  macro  definitions   can   be   placed   into   the
  3228.         'qconfig.dat'  configuration  file  and added to 'q.exe' with the
  3229.         'qconfig.exe' configuration utility (For additional details about
  3230.         QEDIT macro programming see the  QEDIT  documentation).  The  two
  3231.  
  3232.  
  3233.                                      - 53 -
  3234.  
  3235.  
  3236.         macros  perform  the  following  actions:  mark the current word,
  3237.         execute the CFTN or CSTN database search for the marked word  via
  3238.         dos and redirect the output to file 'tmp',  read target file name
  3239.         from 'tmp' and open target file,  read line number from 'tmp' and
  3240.         go to the selected line.
  3241.  
  3242.         These macros are working almost similar to those used from BRIEF,
  3243.         but  they have some limitations in their functionality due to the
  3244.         limited capabilities of the QEDIT macro programming language:
  3245.  
  3246.         -    there is no error check for a correct cursor location,
  3247.         -    the searched item must always be a single word  like  'main'
  3248.              or  'size_t',  a combined pattern like 'struct iobuf' cannot
  3249.              be searched,
  3250.         -    there is no error check if  the  search  was  successful  or
  3251.              failed or the database is not up-to-date,
  3252.         -    if the target file is the same as that from which the search
  3253.              started and other additional files are also open (QEDIT ring
  3254.              buffer), probably a wrong file will be accessed,
  3255.         -    the name of the database cannot be changed, the searches are
  3256.              performed  either with the default database or those defined
  3257.              by the environment variables.
  3258.  
  3259.  
  3260.         SEARCHING INSIDE MicroEMACS (Version 3.11, DOS & WINDOWS)
  3261.  
  3262.         The latest editor which is now supported with macros for database
  3263.         access is MicroEMACS 3.11. The macro file is named CXT_ME.CMD and
  3264.         should be place in the  MircoEMACS  directory.  This  macro  file
  3265.         works with the DOS and the WINDOWS version of MicroEMACS 3.11.
  3266.  
  3267.         The following macros are available:
  3268.  
  3269.         -    cft       function search for tagged item
  3270.         -    cst       data type search for tagged item
  3271.         -    cftmark   function search for marked item
  3272.         -    cstmark   data type search for marked item
  3273.         -    cftfind   function search for user defined item
  3274.         -    cstfind   data type search for user defined item
  3275.         -    cftfile   list of all CFT files
  3276.         -    cstfile   list of all CST files
  3277.         -    cftbase   set CFT database name
  3278.         -    cstbase   set CST database name
  3279.         -    cxtbase   set both CFT and CST database name
  3280.  
  3281.         They can be invoked by loading the macro file CXT_ME.CMD with
  3282.  
  3283.              ESC CTRL+S CXT_ME.CMD
  3284.  
  3285.         and running the macro with
  3286.  
  3287.              ESC CTRL+E <macro name>
  3288.  
  3289.         If  the macros are used with the MicroEMACS WINDOWS version,  you
  3290.         may have to change the DOSEXEC.PIF file,  which is  part  of  the
  3291.         MicroEMACS  3.11  distribution  package.  During  the  CXT  macro
  3292.  
  3293.  
  3294.                                      - 54 -
  3295.  
  3296.  
  3297.         execution,  the shell command may stop after execution and  waits
  3298.         for  the  <return>  key  pressed  to  continue.   To  avoid  this
  3299.         interruption,  you can enable it by  editing  the  PIF  file  and
  3300.         select "Close window after execution".  The environment variables
  3301.         CFTNBASE,  CSTNBASE and CXTNBASE are used in the same way  as  in
  3302.         the  BRIEF version.  Key-assignments to macro procedure names are
  3303.         not performed,  if you prefer hot-keys,  you are free to do  this
  3304.         for yourself.
  3305.  
  3306.         In the MicroEMACS WINDOWS version,  however,  the user accessible
  3307.         macros can be integrated into the "Miscellaneous" pull-down  menu
  3308.         (thanks  to  the  incredible  macro  programming  capabilities of
  3309.         MicroEMACS!).   To  view  the  generated  output  file  with  its
  3310.         semigraphic  frames,  change the font type and select for example
  3311.         the 'TERMINAL'  font  from  the  OEM  font  list  which  supports
  3312.         semigraphic characters.
  3313.  
  3314.  
  3315.  
  3316.  
  3317.  
  3318.  
  3319.  
  3320.  
  3321.  
  3322.  
  3323.  
  3324.  
  3325.  
  3326.  
  3327.  
  3328.  
  3329.  
  3330.  
  3331.  
  3332.  
  3333.  
  3334.  
  3335.  
  3336.  
  3337.  
  3338.  
  3339.  
  3340.  
  3341.  
  3342.  
  3343.  
  3344.  
  3345.  
  3346.  
  3347.  
  3348.  
  3349.  
  3350.  
  3351.  
  3352.  
  3353.  
  3354.  
  3355.                                      - 55 -
  3356.  
  3357.  
  3358.         12   TROUBLE SHOOTING
  3359.  
  3360.         This section contains informations about problems and the several
  3361.         reasons  which  may  occur during the use of SXT programs.  It is
  3362.         strictly  recommended  that  users  should  read   the   complete
  3363.         documentation  to have an overview about the features before they
  3364.         start using CFT and CST and run into any unexpected troubles. See
  3365.         also the chapter about 'PROGRAM LIMITATIONS'.
  3366.  
  3367.         A PROGRAM CANNOT BE EXECUTED
  3368.         The program path is not specified  in  the  environment  variable
  3369.         PATH,  the  programs  are  not  yet  installed  in  the specified
  3370.         directory,  attempt to start a 386 protected mode  version  on  a
  3371.         80286 (or lower) computer.
  3372.  
  3373.         EXECUTION STOPPED WITH MESSAGE "OUT OF MEMORY"
  3374.         An  attempt  to  allocate  memory  has  failed.   Try  to  remove
  3375.         unnecessary memory resident TSR programs and/or use the protected
  3376.         mode versions if you have an 386/486. If this message happens for
  3377.         the protected mode versions,  there is not enough free disk space
  3378.         for the swap file.  Set the temporary directory, defined by 'TMP'
  3379.         resp.  'TEMP'  environment  variables,   to  another  drive,   if
  3380.         possible.
  3381.  
  3382.         WRITING THE OUTPUT FILE TAKES A LONG TIME
  3383.         A  large number of informations must be handled,  option -x or -r
  3384.         is not set and so the output tree chart is very large,  slow  CPU
  3385.         and/or harddisk.  Use option -v to redirect intermediate files to
  3386.         a faster RAM-disk (if such is present).
  3387.  
  3388.         THE RESULTING OUTPUT IS DEEPLY NESTED AND EXCEEDS THE SCREEN SIZE
  3389.         Two reasons: Use the -r or -x option if not already specified  or
  3390.         the source code/data types are indeed deeply nested.
  3391.  
  3392.         THE BRIEF MACROS CANNOT BE EXECUTED
  3393.         The macro file is not loaded, other macros with the same names or
  3394.         assigned keys already exist.
  3395.  
  3396.         THE BRIEF OR MICROEMACS MACROS CANNOT BE LOADED
  3397.         The  path  to  the  macro  file  location  must be specified when
  3398.         loading the macros,  if they are not in the default directory for
  3399.         the editor.
  3400.  
  3401.         THE BRIEF MACROS DO NOT FIND ANY FUNCTIONS OR DATA TYPES
  3402.         There is no access to CFTN,  CSTN,  DFTN (...),  due to incorrect
  3403.         path specification,  no database is  present,  the  path  to  the
  3404.         database files is incorrect, the database name is incorrect.
  3405.  
  3406.         THE BYTE OFFSET CALCULATION FILE "CST_OFFS.C" CANNOT BE COMPILED
  3407.         Several  reasons:  Necessary  data types or include files are not
  3408.         specified or the CST processing was done with include files other
  3409.         than those being used for compiling.  If the number of data  type
  3410.         informations  is  too  large,  some  compilers cannot compile the
  3411.         large number of statements in a single file  generated  from  CST
  3412.         ('out of heap space',  'code segment too large' or other messages
  3413.  
  3414.  
  3415.  
  3416.                                      - 56 -
  3417.  
  3418.  
  3419.         like that).  In that case you may have to  split  the  file  into
  3420.         several  smaller  files  or  reduce  the  number of data types to
  3421.         display.
  3422.  
  3423.         LOCATING ITEMS IN THE BRIEF EDITOR POINTS TO WRONG PLACES
  3424.         Searching items from within the  BRIEF  editor  points  to  wrong
  3425.         lines,  the requested item is not present there or the file seems
  3426.         to be corrupted.  This can have several reasons: The file is  not
  3427.         up-to-date  and has been changed since the database generation so
  3428.         that the line references are no longer valid.  Another reason can
  3429.         be that the source file has explicit #line numbers as it is usual
  3430.         for  files  produced by source code generators like YACC/BISON or
  3431.         LEX/FLEX.  A third  reason  may  be  that  the  source  file  was
  3432.         generated  on an UNIX system and has therefore only LF instead of
  3433.         CR+LF as end-of-line delimiter so that BRIEF cannot  display  the
  3434.         file correctly, the file seems to be written in a single line.
  3435.  
  3436.         UNEXPECTED RESULTS WHILE RUNNING UNDER WINDOWS 3.1
  3437.         The 386 versions cannot run under Windows 3.1, they are using the
  3438.         CPU  exclusive and can therefore not co-exist with Windows,  only
  3439.         the real mode versions can. In Windows enhanced mode (virtual 386
  3440.         mode),  the real  mode  versions  cannot  run  simultaneously  in
  3441.         several  independent  DOS-windows if they are working in the same
  3442.         directory or  use  the  same  temporary  directory,  because  the
  3443.         temporary  intermediate  files  may  have the same names and will
  3444.         conflict due to multiple accesses to the same file. This may also
  3445.         happen if the same files are scanned.
  3446.  
  3447.         MICROEMACS FOR WINDOWS SEEMS TO HANG DURING DATABASE  ACCESS  AND
  3448.         DOES NOT RETURN
  3449.         The reason is usually quite simple: The shell call to DOS through
  3450.         DOSEXEC.PIF  waits  for  a keystroke to continue execution and to
  3451.         return to WINDOWS.  You may change this behaviour by editing  the
  3452.         DOSEXEC.PIF    file   (see   MicroEMACS   section   for   further
  3453.         information).
  3454.  
  3455.  
  3456.  
  3457.  
  3458.  
  3459.  
  3460.  
  3461.  
  3462.  
  3463.  
  3464.  
  3465.  
  3466.  
  3467.  
  3468.  
  3469.  
  3470.  
  3471.  
  3472.  
  3473.  
  3474.  
  3475.  
  3476.  
  3477.                                      - 57 -
  3478.  
  3479.  
  3480.         13   FREQUENTLY ASKED QUESTIONS
  3481.  
  3482.         ARE THERE ANY RESTRICTIONS IN THE USE OF THE ANALYSIS RESULTS?
  3483.         No restrictions for registered users!  They can use  the  results
  3484.         for all purposes like program documentation, customer information
  3485.         or  debugging.  A  notice  about  the name of the program is very
  3486.         welcome.
  3487.  
  3488.         WHY ARE THERE NO INTERACTIVE VERSIONS AVAILABLE?
  3489.         Interactive menu driven SAA-like programs are user  friendly  but
  3490.         need  a  lot of work to program them and require much memory.  As
  3491.         the analysis tools need very much  memory  especially  for  large
  3492.         software projects,  I have decided to satisfy at first the memory
  3493.         needs. The main focus is that the main work should be done on the
  3494.         internal analysis methods and not on the user  interface  layout.
  3495.         In  a  future release there may be also MS-Windows (3.1,  Win32s,
  3496.         NT) versions with interactive user interface. An advantage of the
  3497.         command line versions is the possibility that  they  can  be  run
  3498.         from within an editor or a MAKE file.
  3499.  
  3500.         WHY ARE SEVERAL DATABASE FILES FOR EVERY PROJECT GENERATED?
  3501.         Separating  the  analysis  items  (identifier names,  file names,
  3502.         relationships,  ...) of one project into several closely  related
  3503.         database  files  is  the  best  way  to  achieve  minimum storage
  3504.         requirements and to optimise disk usage.  This way of storage has
  3505.         no redundancies compared to storage in a single database file.
  3506.  
  3507.         WHY IS THERE NO CROSS REFERENCE FOR VARIABLES INCLUDED?
  3508.         This  would  need  much  additional  memory  and  slows  down the
  3509.         analysis process.  There would also be a lot of multiple  defined
  3510.         names  in  different  contexts to be managed if several files are
  3511.         analysed. There also exist a lot of tools which perform this task
  3512.         quite good.
  3513.  
  3514.         WHY ARE CFT AND CST NOT COMBINED IN ONE PROGRAM?
  3515.         Historical and practical reasons: the CFT development was started
  3516.         before CST and both programs are optimised for their own  special
  3517.         purposes.  Combining them would complicate them and slow down the
  3518.         analysis process. Also the memory requirements would grow.
  3519.  
  3520.         WHY DO THE NEW SXT PROGRAM PACKAGES DXT,  FXT AND LXT  NOT  START
  3521.         WITH VERSION 1.00?
  3522.         Because they are directly derived from CXT.  This means that they
  3523.         share a lot of  common  source  code  with  CFT  and  CST.  Every
  3524.         language  independent  feature  is  provided by all programs (see
  3525.         options). Therefore it is easier to have a similar version number
  3526.         for all SXT programs for maintenance and release  purposes.  This
  3527.         may change for future version.
  3528.  
  3529.  
  3530.  
  3531.  
  3532.  
  3533.  
  3534.  
  3535.  
  3536.  
  3537.  
  3538.                                      - 58 -
  3539.  
  3540.  
  3541.         14   REFERENCES
  3542.  
  3543.         Brian  W.  Kernighan,  Dennis  M.  Ritchie:  "The  C  Programming
  3544.         Language", Prentice Hall, Englewood Cliffs, Second Edition 1988
  3545.  
  3546.         Samuel P. Harbison,  Guy L.  Steele Jr.: "C: A Reference Manual",
  3547.         Prentice Hall, Englewood Cliffs, Third Edition 1991
  3548.  
  3549.         Bjarne    Stroustrup:    "The    C++    Programming    Language",
  3550.         Addison-Wesley, Second Edition 1992
  3551.  
  3552.         Margaret  A.   Ellis,   Bjarne  Stroustrup:  "The  Annotated  C++
  3553.         Reference Manual" (ARM), Addison-Wesley, Second Edition 1991
  3554.  
  3555.         "Working  Paper  for  Draft  Proposed  International Standard for
  3556.         Information Systems  -  Programming  Language  C++",  AT&T,  ANSI
  3557.         committee X3J16, ISO working group WG21, January 28, 1993
  3558.  
  3559.         Bjarne Stroustrup, Keith Gorlen, Phil Brown, Dennis Mancl, Andrew
  3560.         Koenig: "UNIX System V - AT&T C++ Language System,  Release 2.1 -
  3561.         Selected Readings", AT&T, 1989
  3562.  
  3563.         Goldberg,  A.: "Programmer as Reader",  IEEE Software,  September
  3564.         1987
  3565.  
  3566.         L.W.  Cannon,  R.A.  Elliot,  L.W.  Kirchhoff,  J.H. Miller, J.M.
  3567.         Milner, R.W. Mitze, E.P. Schan, N.O. Whittington, H. Spencer,  D.
  3568.         Keppel,  M.  Brader:  "Recommended C Style and Coding Standards",
  3569.         Technical Report, in the Public Domain,  Revision 6.0,  July 1991
  3570.         (revised  and  updated  version  of  the  'AT&T Indian Hill style
  3571.         guide',  can be obtained via anonymous FTP from cs.washington.edu
  3572.         in '~ftp/pub/cstyle.tar.Z')
  3573.  
  3574.         A.  Dolenc,  A. Lemmke, D. Keppel, G.V. Reilly: "Notes on Writing
  3575.         Portable Programs in C", Technical Report,  in the Public Domain,
  3576.         Revision 8, November 1990 (can be obtained via anonymous FTP from
  3577.         cs.washington.edu in '~ftp/pub/cport.tar.Z')
  3578.  
  3579.         M.   Henricson,  E.  Nyquist:  "Programming  in  C++,  Rules  and
  3580.         Recommendations",   Technical  Report,   in  the  Public  Domain,
  3581.         Ellemtel  Telecommunication Systems Laboratories,  Alvsjo/Sweden,
  3582.         Document No. M 90 0118 Uen, Rev. C (can be obtained via anonymous
  3583.         FTP from various sites as 'rules.ps.Z' or 'c++rules.ps.Z')
  3584.  
  3585.         Compiler reference manuals and related  documentations  (language
  3586.         references, language implementations and extensions):
  3587.  
  3588.         -    Microsoft C 5.1
  3589.         -    Microsoft C 6.0
  3590.         -    Microsoft C/C++ 7.0
  3591.         -    Microsoft C/C++ for Windows NT (Beta Release March 1993)
  3592.         -    Microsoft VC++ 1.0 for Windows NT (Beta Release June 1993)
  3593.         -    Microsoft C for SCO UNIX System V Rel. 3.2
  3594.         -    Microsoft Macro Assembler MASM 5.1
  3595.         -    Borland Turbo C++ 1.0
  3596.         -    Borland C++ 2.0
  3597.  
  3598.  
  3599.                                      - 59 -
  3600.  
  3601.  
  3602.         -    Borland C++ 3.1
  3603.         -    Borland Turbo Assembler TASM 2.0
  3604.         -    Intel 80860 Metaware High C i860 APX (UNIX-hosted)
  3605.         -    Intel 80960 C-Compiler (ic960, ec960)
  3606.         -    Intel 80960 Assembler (asm960)
  3607.         -    GNU-960 Tools (UNIX-hosted)
  3608.         -    GNU-C Compiler 2.2.2 (C, C++, Objective-C)
  3609.         -    GNU Assembler
  3610.         -    AT&T  C++  2.1  CFRONT  (C++  to  C translator) for SCO UNIX
  3611.              System V Rel. 3.2
  3612.         -    IBM C-Compilers (CC,  XLC) for IBM RS  6000  RISC  stations,
  3613.              AIX 3.15
  3614.         -    HP  C-Compilers (CC,  C89) for HP Apollo 9000 RISC stations,
  3615.              HP-UX 9.0
  3616.         -    VAX C
  3617.  
  3618.  
  3619.  
  3620.  
  3621.  
  3622.  
  3623.  
  3624.  
  3625.  
  3626.  
  3627.  
  3628.  
  3629.  
  3630.  
  3631.  
  3632.  
  3633.  
  3634.  
  3635.  
  3636.  
  3637.  
  3638.  
  3639.  
  3640.  
  3641.  
  3642.  
  3643.  
  3644.  
  3645.  
  3646.  
  3647.  
  3648.  
  3649.  
  3650.  
  3651.  
  3652.  
  3653.  
  3654.  
  3655.  
  3656.  
  3657.  
  3658.  
  3659.  
  3660.                                      - 60 -
  3661.  
  3662.  
  3663.         15   TRADEMARKS
  3664.  
  3665.         All brand or product names  are  trademarks  (TM)  or  registered
  3666.         trademarks (R) of their respective owners.
  3667.  
  3668.         The  following  products  and  names  are  Copyright  (C) Juergen
  3669.         Mueller (J.M.), all rights reserved world-wide:
  3670.  
  3671.              CXT (TM) C EXPLORATION TOOLS
  3672.              CFT (TM) C FUNCTION TREE GENERATOR
  3673.              CFTN (TM) C FUNCTION TREE NAVIGATOR
  3674.              CST (TM) C STRUCTURE TREE GENERATOR
  3675.              CSTN (TM) C STRUCTURE TREE NAVIGATOR
  3676.  
  3677.              DXT (TM) DBASE EXPLORATION TOOLS
  3678.              DFT (TM) DBASE FUNCTION TREE GENERATOR
  3679.              DFTN (TM) DBASE FUNCTION TREE NAVIGATOR
  3680.  
  3681.              FXT (TM) FORTRAN EXPLORATION TOOLS
  3682.              FFT (TM) FORTRAN FUNCTION TREE GENERATOR
  3683.              FFTN (TM) FORTRAN FUNCTION TREE NAVIGATOR
  3684.  
  3685.              LXT (TM) LISP EXPLORATION TOOLS
  3686.              LFT (TM) LISP FUNCTION TREE GENERATOR
  3687.              LFTN (TM) LISP FUNCTION TREE NAVIGATOR
  3688.  
  3689.  
  3690.         The packages CXT, DXT, FXT and LXT are part of
  3691.  
  3692.              SXT (TM) SOFTWARE EXPLORATION TOOLS
  3693.  
  3694.         which provide a similar set of  functionalities  for  the  source
  3695.         code analysis of different programming languages.
  3696.  
  3697.         See  PRODUCT.DOC  for a complete overview of the SXT packages and
  3698.         the different supported platforms.
  3699.  
  3700.  
  3701.  
  3702.  
  3703.  
  3704.  
  3705.  
  3706.  
  3707.  
  3708.  
  3709.  
  3710.  
  3711.  
  3712.  
  3713.  
  3714.  
  3715.  
  3716.  
  3717.  
  3718.  
  3719.  
  3720.  
  3721.                                      - 61 -
  3722.  
  3723.  
  3724.         APPENDIX 1: C-PRECOMPILER DEFINES
  3725.  
  3726.         The  following  list  shows  the  precompiler  defines  for   the
  3727.         supported  compiler  types  (option -T).  It contains the default
  3728.         defines and the optional memory model and architecture defines.
  3729.  
  3730.         Other default compiler defines which are usually declared by some
  3731.         of the compilers are not automatically defined by the -T  option.
  3732.         These  are  defines  for  compilation like WINDOWS,  __WINDOWS__,
  3733.         _Windows,  DLL or __DLL__,  for optimization like __OPTIMIZE__ or
  3734.         __FASTCALL__  or  others  like  those  about  target (operating-)
  3735.         systems like NT, MIPS,  UNIX,  unix,  __unix__,  i386,  __i386__,
  3736.         GNUDOS,  BSD,  VMS, USG, DGUX or hpux. Other sometimes predefined
  3737.         macros are __STRICT_ANSI__ or  __CHAR_UNSIGNED__.  If  necessary,
  3738.         they can be user defined on the command line with the -D option.
  3739.  
  3740.         The  macro  name  __cplusplus will be defined if the command line
  3741.         option '-C++' is set to enable C++ processing.
  3742.  
  3743.         1. MSC51 (Microsoft C 5.1):
  3744.         Default defines:         MSDOS, M_I86
  3745.         C++ specific defines:    (none)
  3746.         Memory model defines:    M_I86SM, M_I86MM, M_I86CM, M_I86LM,
  3747.                                  M_I86HM
  3748.  
  3749.         2. MSC70 (Microsoft C/C++ 7.0):
  3750.         Default defines:         MSDOS, M_I86, _MSC_VER (=700)
  3751.         C++ specific defines:    (none)
  3752.         Memory model defines:    M_I86TM, M_I86SM, M_I86MM, M_I86CM,
  3753.                                  M_I86LM, M_I86HM
  3754.  
  3755.         3. MSVCWNT (Microsoft VC++ 1.0 for Windows NT):
  3756.         Default defines:         MSDOS, M_I86, _MSC_VER (=800),
  3757.                                  _M_IX86 (=300)
  3758.         C++ specific defines:    (none)
  3759.         Memory model defines:    (not necessary)
  3760.  
  3761.         4. TC10 (Borland Turbo C++ 1.0):
  3762.         Default defines:         __MSDOS__, __TURBOC__
  3763.         C++ specific defines:    __TCPLUSPLUS
  3764.         Memory model defines:    __TINY__, __SMALL__, __MEDIUM__,
  3765.                                  __COMPACT_, __LARGE__, __HUGE__
  3766.  
  3767.         5. BC20 (Borland C++ 2.0):
  3768.         Default defines:         __MSDOS__, __BORLANDC__ (=0x0200),
  3769.                                  __TURBOC__ (=0x0297)
  3770.         C++ specific defines:    __BCPLUSPLUS__ (=0x0200),
  3771.                                  __TCPLUSPLUS__ (=0x0200)
  3772.         Memory model defines:    __TINY__, __SMALL__, __MEDIUM__,
  3773.                                  __COMPACT_, __LARGE__, __HUGE__
  3774.  
  3775.         6. BC31 (Borland C++ 3.1):
  3776.         Default defines:         __MSDOS__, __BORLANDC__ (=0x0410),
  3777.                                  __TURBOC__ (=0x0410)
  3778.         C++ specific defines:    __BCPLUSPLUS__ (=0x0310),
  3779.                                  __TCPLUSPLUS__ (=0x0310)
  3780.  
  3781.  
  3782.                                      - 62 -
  3783.  
  3784.  
  3785.         Memory model defines:    __TINY__, __SMALL__, __MEDIUM__,
  3786.                                  __COMPACT_, __LARGE__, __HUGE__
  3787.  
  3788.         6. BC10OS2 (Borland C++ 1.0 for OS/2):
  3789.         Default defines:         __OS2__, __BORLANDC__ (=0x0400),
  3790.                                  __TURBOC__ (=0x0400)
  3791.         C++ specific defines:    __BCPLUSPLUS__ (=0x0320),
  3792.                                  __TCPLUSPLUS__ (=0x0320),
  3793.                                  __TEMPLATES__
  3794.         Memory model defines:    (not necessary)
  3795.  
  3796.         8. GNU (GNU C 2.2.2):
  3797.         Default defines:         __GNUC__ (=2)
  3798.         C++ specific defines:    __GNUG__ (=2)
  3799.         Memory model defines:    (not necessary)
  3800.  
  3801.         9. I960 (Intel iC960 3.0):
  3802.         Default defines:         __i960
  3803.         C++ specific defines:    (none)
  3804.         Memory model defines:    (not necessary)
  3805.         Architecture defines:    __i960KA, __i960KB, __i960SA, __i960SB,
  3806.                                  __i960MC, __i960CA
  3807.  
  3808.  
  3809.  
  3810.  
  3811.  
  3812.  
  3813.  
  3814.  
  3815.  
  3816.  
  3817.  
  3818.  
  3819.  
  3820.  
  3821.  
  3822.  
  3823.  
  3824.  
  3825.  
  3826.  
  3827.  
  3828.  
  3829.  
  3830.  
  3831.  
  3832.  
  3833.  
  3834.  
  3835.  
  3836.  
  3837.  
  3838.  
  3839.  
  3840.  
  3841.  
  3842.  
  3843.                                      - 63 -
  3844.  
  3845.  
  3846.         APPENDIX 2: RESERVED C/C++ KEYWORDS
  3847.  
  3848.         The following list shows the keywords being recognised by CFT and
  3849.         CST,   the  standard  C  keywords,   the  C++  keywords  and  the
  3850.         non-standard  keywords which are compiler dependent extensions to
  3851.         the C or C++ language. Standard C keywords are also C++ keywords,
  3852.         always!  The C++ keywords are recognised only if option '-C++' is
  3853.         set, otherwise they are treated as identifiers. This list may not
  3854.         be  complete  or  correct  due  to  upcoming  new releases of the
  3855.         supported compilers with new  extensions  or  extensions  to  the
  3856.         language  standard.  C++,  for  which till now no 'real' language
  3857.         standard exists (except the de-facto standard,  the  AT&T  CFRONT
  3858.         implementation),    differs    among   several   implementations,
  3859.         especially for the new introduced exception and template concepts
  3860.         (try,  catch,  throw,  template).  Undocumented  but  (obviously)
  3861.         present keywords especially in GNU C (e.g.  __alignof, __classof,
  3862.         ...) or in Microsoft C/C++ 7.0 are  ignored  (even  if  they  are
  3863.         listed here).
  3864.  
  3865.         KEYWORDS       Standard       compiler-specific extension
  3866.                        C    C++       MSC TC/BC GNU C
  3867.                                       7.0 3.0   2.2.2
  3868.         asm            x
  3869.         auto           x
  3870.         break          x
  3871.         case           x
  3872.         catch               x         (x)       x
  3873.         cdecl                         x    x
  3874.         char           x
  3875.         class               x
  3876.         classof                                 x
  3877.         const          x
  3878.         continue       x
  3879.         default        x
  3880.         delete              x
  3881.         do             x
  3882.         double         x
  3883.         dynamic                                 x
  3884.         else           x
  3885.         enum           x
  3886.         except                                  x
  3887.         exception                               x
  3888.         extern         x
  3889.         far                           x    x
  3890.         float          x
  3891.         for            x
  3892.         fortran                       x    x
  3893.         friend              x
  3894.         goto           x
  3895.         huge                          x    x
  3896.         if             x
  3897.         inline              x
  3898.         int            x
  3899.         interrupt                     x    x
  3900.         long           x
  3901.         near                          x    x
  3902.  
  3903.  
  3904.                                      - 64 -
  3905.  
  3906.  
  3907.         new                 x
  3908.         operator            x
  3909.         overload                           x    x
  3910.         pascal                        x    x
  3911.         private             x
  3912.         protected           x
  3913.         public              x
  3914.         register       x
  3915.         return         x
  3916.         short          x
  3917.         signed         x
  3918.         sizeof         x
  3919.         static         x
  3920.         struct         x
  3921.         switch         x
  3922.         template            x
  3923.         this                x
  3924.         throw               x
  3925.         try                 x         (x)       x
  3926.         typedef        x
  3927.         typeof                                  x
  3928.         union          x
  3929.         unsigned       x
  3930.         virtual             x
  3931.         void           x
  3932.         volatile       x
  3933.         while          x
  3934.         __alignof                               x
  3935.         __alignof__                             x
  3936.         __asm                         x         x
  3937.         __asm__                                 x
  3938.         __attribute                             x
  3939.         __attribute__                           x
  3940.         __based                       x
  3941.         __cdecl                       x
  3942.         __classof                               x
  3943.         __classof__                             x
  3944.         __const                       x         x
  3945.         __const__                               x
  3946.         __emit                        x
  3947.         __except                      x
  3948.         __export                      x
  3949.         __extension__                           x
  3950.         __far                         x
  3951.         __fastcall                    x
  3952.         __finally                     x
  3953.         __fortran                     x
  3954.         __headof                                x
  3955.         __headof__                              x
  3956.         __huge                        x
  3957.         __inline                                x
  3958.         __inline__                              x
  3959.         __interrupt                   x
  3960.         __label__                               x
  3961.         __loadds                      x
  3962.         __near                        x
  3963.  
  3964.  
  3965.                                      - 65 -
  3966.  
  3967.  
  3968.         __saveregs                    x
  3969.         __segment                     x
  3970.         __segname                     x
  3971.         __self                        x
  3972.         __signed                                x
  3973.         __signed__                              x
  3974.         __stdcall                     x
  3975.         __syscall                     x
  3976.         __try                         x
  3977.         __typeof                                x
  3978.         __typeof__                              x
  3979.         __volatile                              x
  3980.         __volatile__                            x
  3981.         _asm                          x
  3982.         _based                        x
  3983.         _cdecl                        x
  3984.         _emit                         x
  3985.         _export                       x    x
  3986.         _far                          x
  3987.         _fastcall                     x
  3988.         _fortran                      x
  3989.         _huge                         x
  3990.         _interrupt                    x
  3991.         _loadds                       x    x
  3992.         _near                         x
  3993.         _pascal                       x
  3994.         _saveregs                     x    x
  3995.         _seg                               x
  3996.         _segment                      x
  3997.         _segname                      x
  3998.         _self                         x
  3999.  
  4000.  
  4001.  
  4002.  
  4003.  
  4004.  
  4005.  
  4006.  
  4007.  
  4008.  
  4009.  
  4010.  
  4011.  
  4012.  
  4013.  
  4014.  
  4015.  
  4016.  
  4017.  
  4018.  
  4019.  
  4020.  
  4021.  
  4022.  
  4023.  
  4024.  
  4025.  
  4026.                                      - 66 -
  4027.  
  4028.  
  4029.         APPENDIX 3: EFFICIENCY
  4030.  
  4031.         To  provide some values about the speed and the efficiency of the
  4032.         programs,  tests were performed with CFT386 and  CST386  (version
  4033.         2.12),  running on a 33 MHz 80486 with 8 MB RAM, 256 KB cache and
  4034.         a 15 ms hard disk (no disk cache or RAM-disk installed).
  4035.  
  4036.         The source code for the first test was the C++ part of the  GNU-C
  4037.         compiler  (version  2.2.2),  which  is  the  largest of the three
  4038.         compiler parts (C, C++, Objective-C).  The following results have
  4039.         been found:
  4040.  
  4041.         -    139  files  (71 source files and 68 include files) have been
  4042.              scanned
  4043.         -    a total number of 2330 functions has been found  from  which
  4044.              2248 functions were defined in the 71 source files
  4045.         -    the  directed  call  graph  would  have 2314 nodes and 10301
  4046.              connections
  4047.         -    the critical function call path has a maximum nesting  level
  4048.              of 115
  4049.         -    the  total  size  of  the  139 files is 6.532 MB with 208600
  4050.              lines (about  31  bytes/line),  source  code/filesize  ratio
  4051.              0.739, average function size is 1951 bytes resp. 63 lines
  4052.         -    the  effective  size  of the preprocessed and scanned source
  4053.              code (source files and their included files)  is  20.775  MB
  4054.              with 596500 lines
  4055.         -    the  resulting output file (options -m -rauspP -TGNU -cs -Cs
  4056.              -n) has about 3.94 MB and 36100 lines
  4057.         -    the resulting 6 database files have a size of 727 KB (source
  4058.              code/database ratio is about 9 : 1)
  4059.         -    inside BRIEF,  a database  search  for  the  location  of  a
  4060.              function is performed in less than 4 seconds
  4061.         -    the  total  time  for  the  complete  processing was 31'03''
  4062.              minutes with 26'30''  for  analysis  (includes  18'15''  for
  4063.              preprocessing),  2'50''  for  output file writing and 1'43''
  4064.              for database writing
  4065.         -    the average analysis speed for this source  code  was  about
  4066.              783 KB/min.  respectively 22510 lines/min.  (The values only
  4067.              for source scanning without preprocessing are: 2.51  MB/min.
  4068.              resp. 72300 lines/min.)
  4069.  
  4070.         The CFT386 results for a large commercial project are:
  4071.  
  4072.         -    190 files (132 source files (C and assembler) and 58 include
  4073.              files) have been scanned
  4074.         -    a  total  number of 1223 functions has been found from which
  4075.              1177 functions were defined in  the  132  source  and  in  3
  4076.              include files (some include files contain inline functions)
  4077.         -    the  directed  call  graph  would  have  1223 nodes and 2366
  4078.              connections
  4079.         -    the total size of the 190 files is 6.22 MB with 145550 lines
  4080.              (about 42 bytes/line),  source  code/filesize  ratio  0.533,
  4081.              average function size is 1805 bytes resp. 66 lines
  4082.         -    the  effective  size  of the preprocessed and scanned source
  4083.              code (source files and their included  files)  is  48.42  MB
  4084.              with 959100 lines
  4085.  
  4086.  
  4087.                                      - 67 -
  4088.  
  4089.  
  4090.         -    the  resulting  output file (options -m -rauspP -cs -Cs -na)
  4091.              has about 907 KB and 24700 lines
  4092.         -    the resulting 6 database files have a size of 306 KB (source
  4093.              code/database ratio is about 20 : 1)
  4094.         -    the total time  for  the  complete  processing  was  35'25''
  4095.              minutes  with  34'15'' for analysis,  0'45'' for output file
  4096.              writing and 0'25'' for database writing
  4097.         -    the average analysis speed for this source  code  was  about
  4098.              1.41 MB/min. respectively 28000 lines/min.
  4099.  
  4100.         To get some efficiency values for CST386,  the include files from
  4101.         another commercial project were analysed for data types:
  4102.  
  4103.         -    52 include files have been scanned
  4104.         -    a total number of 605 data types have been found from  which
  4105.              567  structures/unions  were defined in 42 of the 54 include
  4106.              files
  4107.         -    the directed call  graph  would  have  588  nodes  and  1787
  4108.              connections
  4109.         -    the  total size of the 52 files is 1.384 MB with 25410 lines
  4110.              (about 54 bytes/line), source code/filesize ratio 0.343
  4111.         -    the resulting output file (options -rasp  -cs  -Cs  -n)  has
  4112.              about 378 KB and 8740 lines
  4113.         -    the resulting 6 database files have a size of 312 KB (source
  4114.              code/database ratio is about 4.4 : 1)
  4115.         -    the  total  time  for  the  complete  processing  was 1'10''
  4116.              minutes with 0'25'' for analysis,  0'16''  for  output  file
  4117.              writing and 0'29'' for database writing
  4118.         -    the  average  analysis (scanning) speed for this source code
  4119.              was about 3.32 MB/min.  respectively 60980 lines/min  (note:
  4120.              NO preprocessing performed, only scanning!).
  4121.  
  4122.         The  calculated  average values for the analysis speed differ due
  4123.         to the effective size of the  'really'  present  source  code  in
  4124.         relation  to  the  size  of the comments which can be seen by the
  4125.         code/filesize ratio.  The speed values do not consider  that,  if
  4126.         the  preprocessing  option  -P  is set,  the source code is first
  4127.         preprocessed to a temporary file and then analysed  in  a  second
  4128.         step  so  that  large  parts  of  the  source code are read twice
  4129.         (original and preprocessed code) and written  once  (intermediate
  4130.         preprocessor output).
  4131.  
  4132.         With these facts in mind, the analysis speed of CFT and CST seems
  4133.         to be quite acceptable!
  4134.  
  4135.  
  4136.  
  4137.  
  4138.  
  4139.  
  4140.  
  4141.  
  4142.  
  4143.  
  4144.  
  4145.  
  4146.  
  4147.  
  4148.                                      - 68 -
  4149.  
  4150.  
  4151.         APPENDIX 4: SYSTEM REQUIREMENTS
  4152.  
  4153.         DOS real mode versions:
  4154.         -    IBM-AT or 100% compatible with Intel 80286 or higher, 512 KB
  4155.              RAM, hard disk, DOS 3.3 or higher
  4156.  
  4157.         DOS protected mode versions:
  4158.         -    IBM-AT  or 100% compatible with Intel 80386+80387 or higher,
  4159.              2 MB RAM, hard-disk, DOS 3.3 or higher
  4160.  
  4161.  
  4162.  
  4163.         APPENDIX 5: INSTALLATION
  4164.  
  4165.         See INSTALL.DOC for informations.
  4166.  
  4167.  
  4168.  
  4169.  
  4170.                           (THIS DOCUMENT HAS 69 PAGES)
  4171.  
  4172.  
  4173.  
  4174.  
  4175.  
  4176.  
  4177.  
  4178.  
  4179.  
  4180.  
  4181.  
  4182.  
  4183.  
  4184.  
  4185.  
  4186.  
  4187.  
  4188.  
  4189.  
  4190.  
  4191.  
  4192.  
  4193.  
  4194.  
  4195.  
  4196.  
  4197.  
  4198.  
  4199.  
  4200.  
  4201.  
  4202.  
  4203.  
  4204.  
  4205.  
  4206.  
  4207.  
  4208.  
  4209.                                      - 69 -
  4210.